diff options
author | George Hazan <george.hazan@gmail.com> | 2014-12-18 22:42:38 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-12-18 22:42:38 +0000 |
commit | d67e04232b4fff7228a9cdf26fad8f3c28ff1654 (patch) | |
tree | 33123405c999b732665e32b56e07ac9d63d163a5 /src | |
parent | a6b549723c0ed12b60e4e363f7c4a16f692fec6d (diff) |
switсh from runtime functions to Windows ones, to compare strings regardless of current locale
git-svn-id: http://svn.miranda-ng.org/main/trunk@11517 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_core/utils.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mir_core/utils.cpp b/src/mir_core/utils.cpp index 10348a28f1..3d7f526423 100644 --- a/src/mir_core/utils.cpp +++ b/src/mir_core/utils.cpp @@ -380,7 +380,7 @@ MIR_CORE_DLL(int) mir_strcmp(const char *p1, const char *p2) return (p2 == NULL) ? 0 : -1;
if (p2 == NULL)
return 1;
- return strcmp(p1, p2);
+ return CompareStringA(LOCALE_USER_DEFAULT, 0, p1, -1, p2, -1);
}
MIR_CORE_DLL(int) mir_wstrcmp(const wchar_t *p1, const wchar_t *p2)
@@ -389,7 +389,7 @@ MIR_CORE_DLL(int) mir_wstrcmp(const wchar_t *p1, const wchar_t *p2) return (p2 == NULL) ? 0 : -1;
if (p2 == NULL)
return 1;
- return wcscmp(p1, p2);
+ return CompareStringW(LOCALE_USER_DEFAULT, 0, p1, -1, p2, -1);
}
MIR_CORE_DLL(int) mir_strcmpi(const char *p1, const char *p2)
@@ -398,7 +398,7 @@ MIR_CORE_DLL(int) mir_strcmpi(const char *p1, const char *p2) return (p2 == NULL) ? 0 : -1;
if (p2 == NULL)
return 1;
- return stricmp(p1, p2);
+ return CompareStringA(LOCALE_USER_DEFAULT, NORM_IGNORECASE, p1, -1, p2, -1);
}
MIR_CORE_DLL(int) mir_wstrcmpi(const wchar_t *p1, const wchar_t *p2)
@@ -407,5 +407,5 @@ MIR_CORE_DLL(int) mir_wstrcmpi(const wchar_t *p1, const wchar_t *p2) return (p2 == NULL) ? 0 : -1;
if (p2 == NULL)
return 1;
- return wcsicmp(p1, p2);
+ return CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE, p1, -1, p2, -1);
}
|