mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
Prevent Windows "case mismatch" spam when loading files from disk with the Windows Explorer "hide extensions for known file types" option enabled. This simply changes the relevant Bstrcmp() calls to Bstrncmp() calls instead, using the length of the string returned by SHGetFileInfo() as the number of bytes to compare.
git-svn-id: https://svn.eduke32.com/eduke32@3068 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
83dd447621
commit
f7ed6f47de
1 changed files with 6 additions and 3 deletions
|
@ -681,18 +681,21 @@ int32_t (*check_filename_casing_fn)(void) = NULL;
|
|||
static int32_t check_filename_mismatch(const char *filename, int32_t ofs)
|
||||
{
|
||||
const char *fn = filename+ofs;
|
||||
int32_t len;
|
||||
|
||||
// we assume that UNICODE is not #defined, winlayer.c errors out else
|
||||
if (!SHGetFileInfo(filename, -1, &shinf, sizeof(shinf), SHGFI_DISPLAYNAME))
|
||||
return -1;
|
||||
|
||||
if (!Bstrcmp(shinf.szDisplayName, fn))
|
||||
len = Bstrlen(shinf.szDisplayName);
|
||||
|
||||
if (!Bstrncmp(shinf.szDisplayName, fn, len))
|
||||
return 0;
|
||||
|
||||
{
|
||||
char *tfn = Bstrtolower(Bstrdup(fn));
|
||||
|
||||
if (!Bstrcmp(shinf.szDisplayName, tfn))
|
||||
if (!Bstrncmp(shinf.szDisplayName, tfn, len))
|
||||
{
|
||||
Bfree(tfn);
|
||||
return 0;
|
||||
|
@ -700,7 +703,7 @@ static int32_t check_filename_mismatch(const char *filename, int32_t ofs)
|
|||
|
||||
Bstrupr(tfn);
|
||||
|
||||
if (!Bstrcmp(shinf.szDisplayName, tfn))
|
||||
if (!Bstrncmp(shinf.szDisplayName, tfn, len))
|
||||
{
|
||||
Bfree(tfn);
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue