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
1 changed files with 5 additions and 1 deletions

View File

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