aboutsummaryrefslogtreecommitdiff
path: root/bb.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-05-28 22:30:04 -0700
committerBruce Hill <bruce@bruce-hill.com>2019-05-28 22:30:04 -0700
commitf070b5da0340235fc58b011fe43b8d44c6197463 (patch)
tree3dc6cbaafb9c055e4cc105fe513ef0bfbaf1346c /bb.c
parent53ad7396162bb1791361f3e29d5a62a62fee401d (diff)
Adding comment about .
Diffstat (limited to 'bb.c')
-rw-r--r--bb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bb.c b/bb.c
index 0193dc2..f716a14 100644
--- a/bb.c
+++ b/bb.c
@@ -562,6 +562,7 @@ int compare_files(void *v, const void *v1, const void *v2)
char sort = bb->options['s'];
int sign = bb->options['r'] ? -1 : 1;
const entry_t *f1 = *((const entry_t**)v1), *f2 = *((const entry_t**)v2);
+ // *always* put ".." before everything else
int diff = (strcmp(f1->name, "..") == 0) - (strcmp(f2->name, "..") == 0);
if (diff) return -diff;
if (!bb->options['i']) {