Piotr Caban : ntdll: Use _stricmp instead of strcasecmp.
Alexandre Julliard
julliard at winehq.org
Tue Mar 26 16:43:14 CDT 2019
Module: wine
Branch: master
Commit: 3588e5abd4092e1ddf3c0a1ed876ccd865eea09e
URL: https://source.winehq.org/git/wine.git/?a=commit;h=3588e5abd4092e1ddf3c0a1ed876ccd865eea09e
Author: Piotr Caban <piotr at codeweavers.com>
Date: Tue Mar 26 10:26:43 2019 +0100
ntdll: Use _stricmp instead of strcasecmp.
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ntdll/nt.c | 14 +++++++-------
dlls/ntdll/ntdll_misc.h | 2 ++
dlls/ntdll/relay.c | 4 ++--
3 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index 0a59947..f429349 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -1200,19 +1200,19 @@ static inline void get_cpuinfo(SYSTEM_CPU_INFORMATION* info)
while (isspace(*value)) value++;
if ((s = strchr(value,'\n')))
*s='\0';
- if (!strcasecmp(line, "CPU architecture"))
+ if (!_stricmp(line, "CPU architecture"))
{
if (isdigit(value[0]))
info->Level = atoi(value);
continue;
}
- if (!strcasecmp(line, "CPU revision"))
+ if (!_stricmp(line, "CPU revision"))
{
if (isdigit(value[0]))
info->Revision = atoi(value);
continue;
}
- if (!strcasecmp(line, "features"))
+ if (!_stricmp(line, "features"))
{
if (strstr(value, "vfpv3"))
user_shared_data->ProcessorFeatures[PF_ARM_VFP_32_REGISTERS_AVAILABLE] = TRUE;
@@ -1268,19 +1268,19 @@ static inline void get_cpuinfo(SYSTEM_CPU_INFORMATION* info)
while (isspace(*value)) value++;
if ((s = strchr(value,'\n')))
*s='\0';
- if (!strcasecmp(line, "CPU architecture"))
+ if (!_stricmp(line, "CPU architecture"))
{
if (isdigit(value[0]))
info->Level = atoi(value);
continue;
}
- if (!strcasecmp(line, "CPU revision"))
+ if (!_stricmp(line, "CPU revision"))
{
if (isdigit(value[0]))
info->Revision = atoi(value);
continue;
}
- if (!strcasecmp(line, "Features"))
+ if (!_stricmp(line, "Features"))
{
if (strstr(value, "crc32"))
user_shared_data->ProcessorFeatures[PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE] = TRUE;
@@ -2927,7 +2927,7 @@ static ULONG mhz_from_cpuinfo(void)
while ((s >= line) && isspace(*s)) s--;
*(s + 1) = '\0';
value++;
- if (!strcasecmp(line, "cpu MHz")) {
+ if (!_stricmp(line, "cpu MHz")) {
sscanf(value, " %lf", &cmz);
break;
}
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index 2692c43..e188907 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -257,4 +257,6 @@ extern SYSTEM_CPU_INFORMATION cpu_info DECLSPEC_HIDDEN;
NTSTATUS WINAPI RtlHashUnicodeString(PCUNICODE_STRING,BOOLEAN,ULONG,ULONG*);
void WINAPI LdrInitializeThunk(CONTEXT*,void**,ULONG_PTR,ULONG_PTR);
+/* string functions */
+int __cdecl _stricmp( LPCSTR str1, LPCSTR str2 );
#endif
diff --git a/dlls/ntdll/relay.c b/dlls/ntdll/relay.c
index a205086..7974587 100644
--- a/dlls/ntdll/relay.c
+++ b/dlls/ntdll/relay.c
@@ -889,7 +889,7 @@ void RELAY_SetupDLL( HMODULE module )
data->module = module;
data->base = exports->Base;
len = strlen( (char *)module + exports->Name );
- if (len > 4 && !strcasecmp( (char *)module + exports->Name + len - 4, ".dll" )) len -= 4;
+ if (len > 4 && !_stricmp( (char *)module + exports->Name + len - 4, ".dll" )) len -= 4;
len = min( len, sizeof(data->dllname) - 1 );
memcpy( data->dllname, (char *)module + exports->Name, len );
data->dllname[len] = 0;
@@ -1054,7 +1054,7 @@ void SNOOP_SetupDLL(HMODULE hmod)
(*dll)->nrofordinals = exports->NumberOfFunctions;
strcpy( (*dll)->name, name );
p = (*dll)->name + strlen((*dll)->name) - 4;
- if (p > (*dll)->name && !strcasecmp( p, ".dll" )) *p = 0;
+ if (p > (*dll)->name && !_stricmp( p, ".dll" )) *p = 0;
size = exports->NumberOfFunctions * sizeof(SNOOP_FUN);
addr = NULL;
More information about the wine-cvs
mailing list