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
This commit is contained in:
Colin Percival 2007-03-17 16:17:14 +00:00
parent f2d18f3112
commit 486641fcc5

View File

@ -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)