From ba46f1fd21e1f1486738b507b4fcc33c806ad235 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 9 Jun 2012 21:00:49 +0000 Subject: [PATCH] * Use the left triangle char for parent directory instead of '<-' * Make sure parent directory is alway listed first, even when some dir names start with ! (yes, I do use that, as a trick to make sure they list first) git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1963 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/filesel.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/filesel.c b/src/filesel.c index ba616572..d904f800 100644 --- a/src/filesel.c +++ b/src/filesel.c @@ -221,7 +221,7 @@ char * Format_filename(const char * fname, word max_length, int type) if (strcmp(fname,PARENT_DIR)==0) { - strcpy(result,"<-PARENT DIRECTORY"); + strcpy(result,"\x11 PARENT DIRECTORY"); // Append spaces for (c=18; c need_swap + // Drives go at the top of the list, and files go after them if ( current_item->Type < next_item->Type ) need_swap=1; - // Si les deux éléments sont de même type et que le nom du suivant - // est plus petit que celui du courant -> need_swap + // If both elements have the same type, compare the file names, if + // current is alphabetically before, we need to swap, unless it is + // parent directory, which should always go first else if ( (current_item->Type==next_item->Type) && - (FILENAME_COMPARE(current_item->Full_name,next_item->Full_name)>0) ) + (((FILENAME_COMPARE(current_item->Full_name,next_item->Full_name)>0) && + (FILENAME_COMPARE(current_item->Full_name, PARENT_DIR) != 0)) || + (FILENAME_COMPARE(next_item->Full_name, PARENT_DIR) == 0)) + ) need_swap=1;