Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should use case-insensitive comparison when comparing file names #4

Open
anr2me opened this issue Sep 18, 2023 · 1 comment
Open

Should use case-insensitive comparison when comparing file names #4

anr2me opened this issue Sep 18, 2023 · 1 comment

Comments

@anr2me
Copy link

anr2me commented Sep 18, 2023

For example at:

if (!strcmp(ImportDLLName, DLLName))

As some program imports using "KERNEL32.dll" naming while some use "KERNEL32.DLL", and so on.

I'm replacing it with strcasecmp by declaring this:

#ifdef _MSC_VER 
//not #if defined(_WIN32) || defined(_WIN64) because we have strncasecmp in mingw
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#endif

PS: Not sure whether imported function names can be case-insensitive too or not

@pampersrocker
Copy link
Owner

You are correct, the filename should have a case insensitive compare, since on Windows all Filenames are case insensitive.

Function names or Symbol Names in general are however case sensitive, as changes in case would be another function per C/C++ standard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants