From 01bdae2bde27f764c9c422380040ff21de0579b3 Mon Sep 17 00:00:00 2001 From: WormHeamer Date: Thu, 1 Jan 2026 19:57:19 -0500 Subject: don't sort options if empty pattern, don't list .o files --- main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 3367bee..46c440b 100644 --- a/main.c +++ b/main.c @@ -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: ")); -- cgit v1.2.3