fix lister bug that forced linux hidden .files to top of list

master
Alex Baines 2020-02-09 12:25:13 +00:00
parent 44acf3eb26
commit 73b964c3ea
2 changed files with 2 additions and 8 deletions

View File

@ -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] == '.'){

View File

@ -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;