aboutsummaryrefslogtreecommitdiffstats
path: root/kgpg/klinebufferedprocess.cpp
diff options
context:
space:
mode:
authorubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2014-05-05 19:43:02 +0000
committerubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2014-05-05 19:43:02 +0000
commit4620c15677468a9d678fd8d12c337e5827b7e07e (patch)
tree78253549f490849836624ecdeda68852473e6eb7 /kgpg/klinebufferedprocess.cpp
parentremoved empty dirs (diff)
downloadgpg4usb-4620c15677468a9d678fd8d12c337e5827b7e07e.tar.gz
gpg4usb-4620c15677468a9d678fd8d12c337e5827b7e07e.zip
fix decrypt on windows and remove debugging output
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@1107 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'kgpg/klinebufferedprocess.cpp')
-rw-r--r--kgpg/klinebufferedprocess.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/kgpg/klinebufferedprocess.cpp b/kgpg/klinebufferedprocess.cpp
index 00099af..4ee0552 100644
--- a/kgpg/klinebufferedprocess.cpp
+++ b/kgpg/klinebufferedprocess.cpp
@@ -77,10 +77,25 @@ bool KLineBufferedProcess::readLineStandardOutput(QByteArray *line)
// don't copy '\n'
*line = d->m_stdoutBuffer.left(d->m_newlineInStdout);
+
+#ifdef Q_OS_WIN32
+ // sometimes there may be a single "\n", which confuses decrypt on win
+ if(d->m_stdoutBuffer.at(d->m_newlineInStdout) == '\r') {
+ d->m_stdoutBuffer.remove(0, d->m_newlineInStdout + 2);
+ } else {
+ d->m_stdoutBuffer.remove(0, d->m_newlineInStdout + 1);
+ }
+
+ int lepos = d->m_stdoutBuffer.indexOf("\n");
+ if(d->m_stdoutBuffer.at(lepos-1) == '\r') {
+ lepos = lepos - 1;
+ }
+ d->m_newlineInStdout = lepos;
+#else
d->m_stdoutBuffer.remove(0, d->m_newlineInStdout + d->m_lineEnd.length());
d->m_newlineInStdout = d->m_stdoutBuffer.indexOf(d->m_lineEnd);
-
+#endif
return true;
}