diff options
| author | WormHeamer | 2026-01-01 19:57:19 -0500 |
|---|---|---|
| committer | WormHeamer | 2026-01-01 19:57:19 -0500 |
| commit | 01bdae2bde27f764c9c422380040ff21de0579b3 (patch) | |
| tree | ff2e2ca2a95cfecc84e5760e27a65252fcde23aa | |
| parent | 590172e546b3ce9da482efd25e8e0a260eb7833a (diff) | |
don't sort options if empty pattern, don't list .o files
| -rw-r--r-- | main.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1140,7 +1140,8 @@ u32 sort_opt_idx(u32 *dest, Str *src, u32 n, Str pat, Arena *scratch) { scrn++; } } - qsort_opt(dest, scr, scrn); + if (pat.n > 0) + qsort_opt(dest, scr, scrn); return scrn; } @@ -1184,7 +1185,9 @@ again: DA_APUSH(&opt, &e.scratch, S("..")); while ((de = readdir(d))) { if (de->d_name[0] == '.') continue; - Str n = str_dup(str_from_cstr(de->d_name), &e.scratch); + Str dn = str_from_cstr(de->d_name); + if (str_ends(dn, S(".o"))) continue; + Str n = str_dup(dn, &e.scratch); DA_APUSH(&opt, &e.scratch, n); } int o = select_opt(opt.v, opt.n, S("File: ")); |
