NaturalSort: strings start with . treated differently
This commit is contained in:
parent
bb20f230ad
commit
ff03d846eb
1 changed files with 12 additions and 0 deletions
|
@ -489,6 +489,18 @@ signed char String::naturalnocasecmp_to(const String &p_str) const {
|
|||
const CharType *that_str = p_str.c_str();
|
||||
|
||||
if (this_str && that_str) {
|
||||
|
||||
while (*this_str == '.' || *that_str == '.') {
|
||||
if (*this_str++ != '.')
|
||||
return 1;
|
||||
if (*that_str++ != '.')
|
||||
return -1;
|
||||
if (!*that_str)
|
||||
return 1;
|
||||
if (!*this_str)
|
||||
return -1;
|
||||
}
|
||||
|
||||
while (*this_str) {
|
||||
|
||||
if (!*that_str)
|
||||
|
|
Loading…
Reference in a new issue