diff options
author | ache <ache@FreeBSD.org> | 1995-03-24 19:01:25 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1995-03-24 19:01:25 +0000 |
commit | 536b3a6b2ad3c3b94d86839f584c9762503c0c86 (patch) | |
tree | bea596b53769afe4aa081bdd17a45c4c0282203e /gnu/usr.bin/tar | |
parent | 857b1d7800b86f22b02eb7072ec82b8bdec5f0d3 (diff) | |
download | FreeBSD-src-536b3a6b2ad3c3b94d86839f584c9762503c0c86.zip FreeBSD-src-536b3a6b2ad3c3b94d86839f584c9762503c0c86.tar.gz |
Fix -C arg overriding when -T file used
Diffstat (limited to 'gnu/usr.bin/tar')
-rw-r--r-- | gnu/usr.bin/tar/tar.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gnu/usr.bin/tar/tar.c b/gnu/usr.bin/tar/tar.c index 33604bf..6a7f8a2 100644 --- a/gnu/usr.bin/tar/tar.c +++ b/gnu/usr.bin/tar/tar.c @@ -990,9 +990,10 @@ name_gather () { if (*p == '-' && p[1] == 'C' && p[2] == '\0') { - chdir_name = name_next (0); p = name_next (0); - if (!p) + chdir_name = p ? strdup(p) : p; + p = name_next (0); + if (!chdir_name) { msg ("Missing file name after -C"); exit (EX_ARGSBAD); @@ -1034,7 +1035,8 @@ addname (name) if (name[0] == '-' && name[1] == 'C' && name[2] == '\0') { - chdir_name = name_next (0); + name = name_next (0); + chdir_name = name ? strdup(name) : name; name = name_next (0); if (!chdir_name) { |