Commit 5d907050 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

kernel32: Short circuit required length calculation.

parent a901b68f
...@@ -3207,17 +3207,22 @@ INT WINAPI LCMapStringEx(LPCWSTR name, DWORD flags, LPCWSTR src, INT srclen, LPW ...@@ -3207,17 +3207,22 @@ INT WINAPI LCMapStringEx(LPCWSTR name, DWORD flags, LPCWSTR src, INT srclen, LPW
{ {
INT len; INT len;
for (len = 0; srclen; src++, srclen--) if (flags & NORM_IGNORESYMBOLS)
{ {
WCHAR wch = *src; for (len = 0; srclen; src++, srclen--)
/* tests show that win2k just ignores NORM_IGNORENONSPACE, {
* and skips white space and punctuation characters for WCHAR wch = *src;
* NORM_IGNORESYMBOLS. /* tests show that win2k just ignores NORM_IGNORENONSPACE,
*/ * and skips white space and punctuation characters for
if ((flags & NORM_IGNORESYMBOLS) && (get_char_typeW(wch) & (C1_PUNCT | C1_SPACE))) * NORM_IGNORESYMBOLS.
continue; */
len++; if (get_char_typeW(wch) & (C1_PUNCT | C1_SPACE))
continue;
len++;
}
} }
else
len = srclen;
return len; return len;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment