summaryrefslogtreecommitdiffstats
path: root/usr.bin/tar/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tar/tree.c')
-rw-r--r--usr.bin/tar/tree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/tar/tree.c b/usr.bin/tar/tree.c
index 4528eea..944a787 100644
--- a/usr.bin/tar/tree.c
+++ b/usr.bin/tar/tree.c
@@ -311,13 +311,14 @@ tree_next(struct tree *t)
t->tree_errno = errno;
return (t->visit_type = TREE_ERROR_DIR);
}
+ t->depth++;
t->d = opendir(".");
if (t->d == NULL) {
+ tree_ascend(t); /* Undo "chdir" */
tree_pop(t);
t->tree_errno = errno;
return (t->visit_type = TREE_ERROR_DIR);
}
- t->depth++;
t->flags &= ~hasLstat;
t->flags &= ~hasStat;
t->basename = ".";
OpenPOWER on IntegriCloud