diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-05-31 13:26:23 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-05-31 13:26:23 -0700 |
| commit | 961ac49f81eb9f4de7acb1adfd8836b07857fe2c (patch) | |
| tree | fbc7da06548dda8dfe3e45dd5a41323b6c397c91 /bb.c | |
| parent | 17ce3f08df89700cdd83ae993f839eb9ad43dbe7 (diff) | |
Simplifying interleave code and adding doc
Diffstat (limited to 'bb.c')
| -rw-r--r-- | bb.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -569,14 +569,13 @@ int compare_files(const void *v1, const void *v2, void *v) bb_t *bb = (bb_t*)v; const entry_t *e1 = *((const entry_t**)v1), *e2 = *((const entry_t**)v2); + int sign = 1; if (!bb->interleave_dirs) { - // Ingore sign - if (E_ISDIR(e1) != E_ISDIR(e2)) - return E_ISDIR(e1) < E_ISDIR(e2) ? 1 : -1; + COMPARE(E_ISDIR(e1), E_ISDIR(e2)); } for (char *sort = bb->sort + 1; *sort; sort += 2) { - int sign = sort[-1] == '-' ? -1 : 1; + sign = sort[-1] == '-' ? -1 : 1; switch (*sort) { case COL_SELECTED: COMPARE(IS_SELECTED(e1), IS_SELECTED(e2)); break; case COL_NAME: { |
