diff options
author | cperciva <cperciva@FreeBSD.org> | 2007-03-17 16:17:14 +0000 |
---|---|---|
committer | cperciva <cperciva@FreeBSD.org> | 2007-03-17 16:17:14 +0000 |
commit | 117ac27300d0e34f21bf6102e3b81e7057c467e9 (patch) | |
tree | 48de37776737a768b1dcc5b38a5e9aff602fdbed /usr.bin/tar | |
parent | 820da8080755db82e36689306abdb1572440348f (diff) | |
download | FreeBSD-src-117ac27300d0e34f21bf6102e3b81e7057c467e9.zip FreeBSD-src-117ac27300d0e34f21bf6102e3b81e7057c467e9.tar.gz |
Fix logic bug; we want to do_chdir if arg doesn't start with / _and_ it
doesn't start with @/ either.
This unbreaks "tar -c -C /no/such/directory @/path/to/archive".
MFC after: 3 days
Diffstat (limited to 'usr.bin/tar')
-rw-r--r-- | usr.bin/tar/write.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/tar/write.c b/usr.bin/tar/write.c index 7353439..476730d 100644 --- a/usr.bin/tar/write.c +++ b/usr.bin/tar/write.c @@ -450,7 +450,7 @@ write_archive(struct archive *a, struct bsdtar *bsdtar) } set_chdir(bsdtar, arg); } else { - if (*arg != '/' || (arg[0] == '@' && arg[1] != '/')) + if (*arg != '/' && (arg[0] != '@' || arg[1] != '/')) do_chdir(bsdtar); /* Handle a deferred -C */ if (*arg == '@') { if (append_archive(bsdtar, a, arg + 1) != 0) |