commit a9cdbac7ebc9876c9923bfad29d583016a23e176
parent 7f97738e676af2cf287c78933a02e87cdc54922a
Author: bsandro <[email protected]>
Date: Wed, 11 Sep 2024 23:00:22 +0300
Sorting names alphabetically
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/gui/main.c b/gui/main.c
@@ -228,7 +228,7 @@ int ButtonDialogOpenEvent(UIElement *element, UIMessage msg, int di, void *dp) {
+ (bug) displayed file name is truncated
- move the whole subroutine into a separate file
+ (bug) reset scroll on directory change
-- sort filenames alphabetically
++ sort names alphabetically
+ (bug) path and name are being concatenated during copying
- prohibit interaction with parent window
*/
@@ -247,11 +247,12 @@ static int FilelistFilter(const struct dirent *f) {
static int FilelistCompare(const struct dirent **a, const struct dirent **b) {
if ((*a)->d_type==DT_DIR && (*b)->d_type==DT_DIR) {
if (strncmp((*a)->d_name, "..", 255)==0) return -1;
- if (strncmp((*b)->d_name, "..", 255)==0) return 1;
+ else if (strncmp((*b)->d_name, "..", 255)==0) return 1;
+ else return alphasort(a, b);
}
if ((*a)->d_type==DT_DIR) return -1;
if ((*b)->d_type==DT_DIR) return 1;
- return 0;
+ return alphasort(a, b);
}
int TableEvent(UIElement *element, UIMessage msg, int di, void *dp) {