Index: tools/genlang =================================================================== --- tools/genlang (revision 13634) +++ tools/genlang (working copy) @@ -325,7 +325,7 @@ # # Now start the scanning of the selected language string # - +my $sort_string; # sort order string is placed in a seperate buffer open(LANG, "<$input") || die "couldn't read language file named $input\n"; my @phrase; while() { @@ -397,6 +397,10 @@ if($idstr =~ /^VOICE/) { $idnum = $voiceid++; } + elsif ($idstr =~ /^LANG_ORDERING_STRING/) { + $sort_string = $dest; + next; + } else { $idnum = $idcount++; } @@ -471,6 +475,16 @@ } } } +if ($sort_string) { + $idstr = "LANG_ORDERING_STRING"; + $idnum = $idcount++; # needs to go after the voice strings + $id{$idstr} = $idnum; + $idnum[$idnum]=$idstr; + + $source{$idstr}=$sort_string; + $dest{$idstr}=$sort_string; + $voice{$idstr}=""; +} if($prefix) { # We create a .c and .h file Index: apps/misc.h =================================================================== --- apps/misc.h (revision 13634) +++ apps/misc.h (working copy) @@ -21,6 +21,8 @@ #include +int alphabetical_strcmp(char *s1, char *s2); + /* Format a large-range value for output, using the appropriate unit so that * the displayed value is in the range 1 <= display < 1000 (1024 for "binary" * units) if possible, and 3 significant digits are shown. If a buffer is Index: apps/lang/english.lang =================================================================== --- apps/lang/english.lang (revision 13634) +++ apps/lang/english.lang (working copy) @@ -30,6 +30,20 @@ # used to simply get the full set of english strings for a particular target. # + id: LANG_ORDERING_STRING + desc: + user: + + *: "" + + + *: "0123456789AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz" + + + *: "" + + + id: LANG_SET_BOOL_YES desc: bool true representation user: Index: apps/filetree.c =================================================================== --- apps/filetree.c (revision 13634) +++ apps/filetree.c (working copy) @@ -187,13 +187,13 @@ if (global_settings.sort_case) return strncmp(e1->name, e2->name, MAX_PATH); else - return strncasecmp(e1->name, e2->name, MAX_PATH); + return alphabetical_strcmp(e1->name, e2->name); case 4: /* sort alphabetically desc */ if (global_settings.sort_case) return strncmp(e2->name, e1->name, MAX_PATH); else - return strncasecmp(e2->name, e1->name, MAX_PATH); + return alphabetical_strcmp(e2->name, e1->name); case 1: /* sort date */ return e1->time_write - e2->time_write; Index: apps/misc.c =================================================================== --- apps/misc.c (revision 13634) +++ apps/misc.c (working copy) @@ -71,6 +71,24 @@ #endif #endif +int alphabetical_strcmp(char *s1, char *s2) +{ + char *alphabet_string = str(LANG_ORDERING_STRING); + char *c1, *c2; + while (*s1 && *s2) + { + c1 = strchr(alphabet_string, *s1++); + c2 = strchr(alphabet_string, *s2++); + if (c1 && c2) + { + if (c1 != c2) + return c1 - c2; + else return (c1)?1:0; + } + } + return (*s1)?-1:(*s2)?1:0; +} + /* Format a large-range value for output, using the appropriate unit so that * the displayed value is in the range 1 <= display < 1000 (1024 for "binary" * units) if possible, and 3 significant digits are shown. If a buffer is