diff options
Diffstat (limited to 'source/blender/blenlib/intern/string.c')
-rw-r--r-- | source/blender/blenlib/intern/string.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c index 76193ba9a13..6afc34ba630 100644 --- a/source/blender/blenlib/intern/string.c +++ b/source/blender/blenlib/intern/string.c @@ -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; |