common: fix rich text markup skipping in EsStringCompare with empty strings

This commit is contained in:
nakst 2022-02-14 09:35:57 +00:00
parent 7aad347fe5
commit 8f411e35b7
1 changed files with 3 additions and 3 deletions

View File

@ -947,13 +947,13 @@ int EsStringCompare(const char *s1, ptrdiff_t _length1, const char *s2, ptrdiff_
size_t length1 = _length1, length2 = _length2;
while (length1 || length2) {
if (!length1) return -1;
if (!length2) return 1;
// Skip over rich text markup.
if (*s1 == '\a') while (length1 && *s1 != ']') s1++, length1--;
if (*s2 == '\a') while (length2 && *s2 != ']') s2++, length2--;
if (!length1) return -1;
if (!length2) return 1;
char c1 = *s1;
char c2 = *s2;