From 73b964c3ea52e85c84f636598aaa5e379e452865 Mon Sep 17 00:00:00 2001 From: Alex Baines Date: Sun, 9 Feb 2020 12:25:13 +0000 Subject: [PATCH] fix lister bug that forced linux hidden .files to top of list --- custom/4coder_lister_base.cpp | 3 ++- platform_linux/linux_4ed_functions.cpp | 7 ------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/custom/4coder_lister_base.cpp b/custom/4coder_lister_base.cpp index 7e98b502..4d398875 100644 --- a/custom/4coder_lister_base.cpp +++ b/custom/4coder_lister_base.cpp @@ -329,7 +329,8 @@ lister_get_filtered(Arena *arena, Lister *lister){ if (string_match_insensitive(node_string, key) && filtered.exact_matches.count == 0){ filtered.exact_matches.node_ptrs[filtered.exact_matches.count++] = node; } - else if (!has_wildcard && + else if (key.size > 0 && + !has_wildcard && string_match_insensitive(string_prefix(node_string, key.size), key) && node->string.size > key.size && node->string.str[key.size] == '.'){ diff --git a/platform_linux/linux_4ed_functions.cpp b/platform_linux/linux_4ed_functions.cpp index c92687d0..472762e1 100644 --- a/platform_linux/linux_4ed_functions.cpp +++ b/platform_linux/linux_4ed_functions.cpp @@ -149,19 +149,12 @@ system_get_file_list(Arena* arena, String_Const_u8 directory){ *fip++ = f; } - // NOTE(inso): I want to sort them like this (. files lower), but it looks like - // the sorting is done on the custom-layer side (lister), so this is pointless. - // TODO(inso): add linux-specific custom layer code? - - /* qsort(result.infos, result.count, sizeof(File_Info*), (__compar_fn_t)&linux_compare_file_infos); for(u32 i = 0; i < result.count - 1; ++i) { result.infos[i]->next = result.infos[i+1]; } - result.infos[result.count-1]->next = NULL; - */ } return result;