[git] GnuPG - branch, master, updated. gnupg-2.1.0beta1-36-g13acd78

by Werner Koch cvs at cvs.gnupg.org
Wed Jan 19 18:24:51 CET 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, master has been updated
       via  13acd78a39750e3990684a5bb0951fe0db83fc5a (commit)
      from  af500f0ae490bc4262419fa52bac62677e1672fa (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 13acd78a39750e3990684a5bb0951fe0db83fc5a
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Jan 19 18:05:15 2011 +0100

    Fixed a CR/LF problem on Windows

diff --git a/agent/ChangeLog b/agent/ChangeLog
index ce1fdcc..542695b 100644
--- a/agent/ChangeLog
+++ b/agent/ChangeLog
@@ -1,3 +1,7 @@
+2011-01-19  Werner Koch  <wk at g10code.com>
+
+	* trustlist.c (read_one_trustfile): Also chop an CR.
+
 2010-12-02  Werner Koch  <wk at g10code.com>
 
 	* gpg-agent.c (CHECK_OWN_SOCKET_INTERVAL) [W32CE]: Set to 60
diff --git a/agent/trustlist.c b/agent/trustlist.c
index 791df96..d565982 100644
--- a/agent/trustlist.c
+++ b/agent/trustlist.c
@@ -139,8 +139,9 @@ read_one_trustfile (const char *fname, int allow_include,
   while (es_fgets (line, DIM(line)-1, fp))
     {
       lnr++;
-      
-      if (!*line || line[strlen(line)-1] != '\n')
+
+      n = strlen (line);
+      if (!n || line[n-1] != '\n')
         {
           /* Eat until end of line. */
           while ( (c=es_getc (fp)) != EOF && c != '\n')
@@ -151,7 +152,9 @@ read_one_trustfile (const char *fname, int allow_include,
                      fname, lnr, gpg_strerror (err));
           continue;
         }
-      line[strlen(line)-1] = 0; /* Chop the LF. */
+      line[--n] = 0; /* Chop the LF. */
+      if (n && line[n-1] == '\r')
+        line[--n] = 0; /* Chop an optional CR. */
       
       /* Allow for empty lines and spaces */
       for (p=line; spacep (p); p++)

-----------------------------------------------------------------------

Summary of changes:
 agent/ChangeLog   |    4 ++++
 agent/trustlist.c |    9 ++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list