On Windows, don't try to lowercase/uppercase filenames.

Most of the time, Windows file name lookup is case-insensitive. Reading the
docs (see MSDN's CreateFile help, for example), it seems like case-sensitivity
can be controlled on a per-file basis where applicable (NTFS), but people
should be concerned about matching case in the DEFs/on disk *especially* in
that case.

Also, note that this hack will not always help on systems with case-sensitive
lookup.

git-svn-id: https://svn.eduke32.com/eduke32@2693 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-05-25 15:23:58 +00:00
parent 68c701fb4a
commit 000cfffe32

View file

@ -359,6 +359,7 @@ int32_t findfrompath(const char *fn, char **where)
*where = Bstrdup(fn); *where = Bstrdup(fn);
return 0; return 0;
} }
#ifndef _WIN32
else else
{ {
char *tfn = Bstrtolower(Bstrdup(fn)); char *tfn = Bstrtolower(Bstrdup(fn));
@ -379,6 +380,7 @@ int32_t findfrompath(const char *fn, char **where)
Bfree(tfn); Bfree(tfn);
} }
#endif
} }
for (pfn = (char *)fn; toupperlookup[*pfn] == '/'; pfn++); for (pfn = (char *)fn; toupperlookup[*pfn] == '/'; pfn++);
@ -417,6 +419,7 @@ int32_t findfrompath(const char *fn, char **where)
return 0; return 0;
} }
#ifndef _WIN32
//Check with all lowercase //Check with all lowercase
strcpy(pfn, sp->path); strcpy(pfn, sp->path);
Bstrtolower(tfn); Bstrtolower(tfn);
@ -440,9 +443,10 @@ int32_t findfrompath(const char *fn, char **where)
Bfree(tfn); Bfree(tfn);
return 0; return 0;
} }
#endif
Bfree(tfn); Bfree(tfn);
} }
Bfree(pfn); Bfree(ffn); Bfree(pfn); Bfree(ffn);
return -1; return -1;
} }