aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-06-10 22:55:53 -0700
committerBruce Hill <bruce@bruce-hill.com>2019-06-10 22:55:53 -0700
commite094108f11e6061b09d5c4056bd8fc6397707f2c (patch)
tree6690067ae52ecabe0738299953fb461e135eee69
parent75c59302d926f560647e686ef3c26ef3c8936685 (diff)
Don't show '..' from '/'
-rw-r--r--bb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bb.c b/bb.c
index bf73e97..06c6197 100644
--- a/bb.c
+++ b/bb.c
@@ -931,7 +931,7 @@ void populate_files(bb_t *bb, const char *path)
for (struct dirent *dp; (dp = readdir(dir)) != NULL; ) {
if (dp->d_name[0] == '.') {
if (dp->d_name[1] == '.' && dp->d_name[2] == '\0') {
- if (!bb->show_dotdot) continue;
+ if (!bb->show_dotdot || strcmp(pathbuf, "/") == 0) continue;
} else if (dp->d_name[1] == '\0') {
if (!bb->show_dot) continue;
} else if (!bb->show_dotfiles) continue;