aboutsummaryrefslogtreecommitdiffstats
path: root/tools/gpgtar-extract.c
diff options
context:
space:
mode:
authorAndre Heinecke <[email protected]>2017-11-15 08:54:05 +0000
committerAndre Heinecke <[email protected]>2017-11-15 08:56:22 +0000
commit878b8bfdcc3a8becfc46b9287a2d14cd3c875f28 (patch)
tree4934da2be38c54c8b3079488c5dbada15175b1b4 /tools/gpgtar-extract.c
parentdoc: fix NEWSIG documentation (diff)
downloadgnupg-878b8bfdcc3a8becfc46b9287a2d14cd3c875f28.tar.gz
gnupg-878b8bfdcc3a8becfc46b9287a2d14cd3c875f28.zip
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 <[email protected]>
Diffstat (limited to '')
-rw-r--r--tools/gpgtar-extract.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/gpgtar-extract.c b/tools/gpgtar-extract.c
index b0e17cb10..8613d193f 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)