Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-01-21 18:25:07 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-01-21 18:27:49 +0400
commitba49d7e0e338b2b85cc162d265280bac8dc859cc (patch)
tree3261c52f06a063e890792c8bc0c2d80626e4a6b7 /source/blender/editors
parent3e1f78a6115390dde78bf53b150d72a930fc4f04 (diff)
Fix T38303: Inconsistent sorting of names in Append/Link view
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_file/filelist.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 748a0bd884c..113c7e77d73 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -188,8 +188,15 @@ static int compare_name(const void *a1, const void *a2)
if (strcmp(entry2->relname, ".") == 0) return (1);
if (strcmp(entry1->relname, "..") == 0) return (-1);
if (strcmp(entry2->relname, "..") == 0) return (1);
-
- return (BLI_natstrcmp(entry1->relname, entry2->relname));
+
+ {
+ int cmp = BLI_natstrcmp(entry1->relname, entry2->relname);
+ if (cmp == 0) {
+ /* when strings are a case insensitive match, we don't want a random order for qsort [#38303] */
+ cmp = strcmp(entry1->relname, entry2->relname);
+ }
+ return cmp;
+ }
}
static int compare_date(const void *a1, const void *a2)