[Pkg-gnupg-commit] [gnupg2] 07/20: gpgtar: Prefer --set-filename over implicit name

Daniel Kahn Gillmor dkg at fifthhorseman.net
Fri Dec 1 01:51:49 UTC 2017


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository gnupg2.

commit 878b8bfdcc3a8becfc46b9287a2d14cd3c875f28
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed Nov 15 09:54:05 2017 +0100

    gpgtar: Prefer --set-filename over implicit name
    
    * tools/gpgtar-extract.c: Prefer opt.filename over filename
    for the directory prefix.
    
    --
    If you would extract from stdin (filename -) and use set-filename
    to provide a real filename the "-" would be used for the directory
    name. With this change an explicit filename is prefered.
    
    GnuPG-Bug-Id: T3500
    Signed-off-by: Andre Heinecke <aheinecke at intevation.de>
---
 tools/gpgtar-extract.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/gpgtar-extract.c b/tools/gpgtar-extract.c
index b0e17cb..8613d19 100644
--- a/tools/gpgtar-extract.c
+++ b/tools/gpgtar-extract.c
@@ -345,21 +345,21 @@ gpgtar_extract (const char *filename, int decrypt)
     dirname = xtrystrdup (opt.directory);
   else
     {
-      if (filename)
+      if (opt.filename)
         {
-          dirprefix = strrchr (filename, '/');
+          dirprefix = strrchr (opt.filename, '/');
           if (dirprefix)
             dirprefix++;
           else
-            dirprefix = filename;
+            dirprefix = opt.filename;
         }
-      else if (opt.filename)
+      else if (filename)
         {
-          dirprefix = strrchr (opt.filename, '/');
+          dirprefix = strrchr (filename, '/');
           if (dirprefix)
             dirprefix++;
           else
-            dirprefix = opt.filename;
+            dirprefix = filename;
         }
 
       if (!dirprefix || !*dirprefix)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list