[svn] gpgme - r1304 - trunk/gpgme
svn author marcus
cvs at cvs.gnupg.org
Sat Feb 16 00:07:30 CET 2008
Author: marcus
Date: 2008-02-16 00:07:29 +0100 (Sat, 16 Feb 2008)
New Revision: 1304
Modified:
trunk/gpgme/ChangeLog
trunk/gpgme/engine-gpgconf.c
Log:
2008-02-15 Marcus Brinkmann <marcus at g10code.de>
* engine-gpgconf.c (gpgconf_read): Fix end-of-line handline.
Modified: trunk/gpgme/ChangeLog
===================================================================
--- trunk/gpgme/ChangeLog 2008-02-15 23:02:26 UTC (rev 1303)
+++ trunk/gpgme/ChangeLog 2008-02-15 23:07:29 UTC (rev 1304)
@@ -1,3 +1,7 @@
+2008-02-15 Marcus Brinkmann <marcus at g10code.de>
+
+ * engine-gpgconf.c (gpgconf_read): Fix end-of-line handline.
+
2008-02-14 Werner Koch <wk at g10code.com>
* w32-io.c (_gpgme_io_spawn): Add arg R_PID to return the pid.
Modified: trunk/gpgme/engine-gpgconf.c
===================================================================
--- trunk/gpgme/engine-gpgconf.c 2008-02-15 23:02:26 UTC (rev 1303)
+++ trunk/gpgme/engine-gpgconf.c 2008-02-15 23:07:29 UTC (rev 1304)
@@ -232,24 +232,24 @@
nread = _gpgme_io_read (rp[0], &line[linelen], LINELENGTH - linelen - 1);
if (nread > 0)
{
- line[linelen + nread] = '\0';
linelen += nread;
+ line[linelen] = '\0';
while ((mark = strchr (line, '\n')))
{
char *eol = mark;
- if (eol > &line[0] && *eol == '\r')
+ if (eol > line && eol[-1] == '\r')
eol--;
*eol = '\0';
-
+
/* Got a full line. */
err = (*cb) (hook, line);
if (err)
break;
- linelen -= mark - line;
- memmove (line, eol + 1, linelen);
+ linelen -= mark + 1 - line;
+ memmove (line, mark + 1, linelen);
}
}
}
More information about the Gnupg-commits
mailing list