[git] GnuPG - branch, master, updated. gnupg-2.1.6-11-g69d2c9b

by Werner Koch cvs at cvs.gnupg.org
Wed Jul 22 11:08:49 CEST 2015


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  69d2c9b09bd9d0b86b9f2feb585037a2c11795b0 (commit)
      from  9901be395684dd1b35d83685a719291347684ab1 (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 69d2c9b09bd9d0b86b9f2feb585037a2c11795b0
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Jul 22 11:05:32 2015 +0200

    Avoid a leading double slash in make_filename.
    
    * common/stringhelp.c (do_make_filename): Special case leading '/'.

diff --git a/common/stringhelp.c b/common/stringhelp.c
index 6714eb8..576c2ea 100644
--- a/common/stringhelp.c
+++ b/common/stringhelp.c
@@ -493,7 +493,13 @@ do_make_filename (int xmode, const char *first_part, va_list arg_ptr)
 
   xfree (home_buffer);
   for (argc=0; argv[argc]; argc++)
-    p = stpcpy (stpcpy (p, "/"), argv[argc]);
+    {
+      /* Avoid a leading double slash if the first part was "/".  */
+      if (!argc && name[0] == '/' && !name[1])
+        p = stpcpy (p, argv[argc]);
+      else
+        p = stpcpy (stpcpy (p, "/"), argv[argc]);
+    }
 
   if (want_abs)
     {
@@ -543,7 +549,13 @@ do_make_filename (int xmode, const char *first_part, va_list arg_ptr)
               memcpy (home_buffer, p, p - name + 1);
               p = home_buffer + (p - name + 1);
             }
-          strcpy (stpcpy (stpcpy (p, home), "/"), name);
+
+          /* Avoid a leading double slash if the cwd is "/".  */
+          if (home[0] == '/' && !home[1])
+            strcpy (stpcpy (p, "/"), name);
+          else
+            strcpy (stpcpy (stpcpy (p, home), "/"), name);
+
           xfree (name);
           name = home_buffer;
           /* Let's do a simple compression to catch the most common

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

Summary of changes:
 common/stringhelp.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)


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




More information about the Gnupg-commits mailing list