bpo-28269: Replace strcasecmp with system function _stricmp. (GH-13095)

This commit is contained in:
Minmin Gong 2019-07-13 06:11:43 -07:00 committed by Serhiy Storchaka
parent b5bbb8a740
commit 05f2d84cae
2 changed files with 2 additions and 19 deletions

View File

@ -0,0 +1 @@
Replace use of :c:func:`strcasecmp` for the system function :c:func:`_stricmp`. Patch by Minmin Gong.

View File

@ -38,24 +38,6 @@ const char *_PyImport_DynLoadFiletab[] = {
NULL NULL
}; };
/* Case insensitive string compare, to avoid any dependencies on particular
C RTL implementations */
static int strcasecmp (const char *string1, const char *string2)
{
int first, second;
do {
first = tolower(*string1);
second = tolower(*string2);
string1++;
string2++;
} while (first && first == second);
return (first - second);
}
/* Function to return the name of the "python" DLL that the supplied module /* Function to return the name of the "python" DLL that the supplied module
directly imports. Looks through the list of imported modules and directly imports. Looks through the list of imported modules and
returns the first entry that starts with "python" (case sensitive) and returns the first entry that starts with "python" (case sensitive) and
@ -297,7 +279,7 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix,
import_python = GetPythonImport(hDLL); import_python = GetPythonImport(hDLL);
if (import_python && if (import_python &&
strcasecmp(buffer,import_python)) { _stricmp(buffer,import_python)) {
PyErr_Format(PyExc_ImportError, PyErr_Format(PyExc_ImportError,
"Module use of %.150s conflicts " "Module use of %.150s conflicts "
"with this version of Python.", "with this version of Python.",