◐ Shell
clean mode source ↗

bpo-28269: Replace strcasecmp with system function _stricmp. (GH-13095) · python/cpython@05f2d84

@@ -38,24 +38,6 @@ const char *_PyImport_DynLoadFiletab[] = {

3838

NULL

3939

};

404041-

/* Case insensitive string compare, to avoid any dependencies on particular

42-

C RTL implementations */

43-44-

static int strcasecmp (const char *string1, const char *string2)

45-

{

46-

int first, second;

47-48-

do {

49-

first = tolower(*string1);

50-

second = tolower(*string2);

51-

string1++;

52-

string2++;

53-

} while (first && first == second);

54-55-

return (first - second);

56-

}

57-58-5941

/* Function to return the name of the "python" DLL that the supplied module

6042

directly imports. Looks through the list of imported modules and

6143

returns the first entry that starts with "python" (case sensitive) and

@@ -297,7 +279,7 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix,

297279

import_python = GetPythonImport(hDLL);

298280299281

if (import_python &&

300-

strcasecmp(buffer,import_python)) {

282+

_stricmp(buffer,import_python)) {

301283

PyErr_Format(PyExc_ImportError,

302284

"Module use of %.150s conflicts "

303285

"with this version of Python.",