summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c7
1 files 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: "));