minor bugfix [#24085] NULL character is last

so "blah.blend" comes before "blah 1.blend"
This commit is contained in:
2010-10-01 13:30:09 +00:00
parent 2e44e06450
commit efb98f2499

View File

@@ -311,8 +311,13 @@ int BLI_natstrcmp(const char *s1, const char *s2)
c1 = tolower(s1[d1]);
c2 = tolower(s2[d2]);
}
if (c1<c2) {
/* first check for '.' so "foo.bar" comes before "foo 1.bar" */
if(c1=='.' && c2!='.')
return -1;
if(c1!='.' && c2=='.')
return 1;
else if (c1<c2) {
return -1;
} else if (c1>c2) {
return 1;