Fix T38303: same names with different case sorted unpredictable in the file browser.
The string comparison was in lower case, so the same strings with different case were considered the same which can make qsort give different results on each sort since it's not a stable sort. Now take case into account in comparison.
This commit is contained in:
@@ -547,7 +547,13 @@ int BLI_natstrcmp(const char *s1, const char *s2)
|
||||
d1++;
|
||||
d2++;
|
||||
}
|
||||
return tiebreaker;
|
||||
|
||||
if (tiebreaker)
|
||||
return tiebreaker;
|
||||
|
||||
/* we might still have a different string because of lower/upper case, in
|
||||
* that case fall back to regular string comparison */
|
||||
return strcmp(s1, s2);
|
||||
}
|
||||
|
||||
void BLI_timestr(double _time, char *str, size_t maxlen)
|
||||
|
||||
Reference in New Issue
Block a user