mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 00:41:55 +00:00
- for Unix-like systems, check added resources for lower and uppercase variants if the specified one cannot be found.
This commit is contained in:
parent
20248d8e08
commit
bce15428d5
1 changed files with 18 additions and 0 deletions
|
@ -203,6 +203,24 @@ bool D_AddFile(TArray<FString>& wadfiles, const char* file, bool check, int posi
|
|||
{
|
||||
return false;
|
||||
}
|
||||
#ifdef __unix__
|
||||
// Test case sensitively, pure lowercase and pure uppercase.
|
||||
FString checks = file;
|
||||
struct stat info;
|
||||
bool res = stat(file, &info) == 0;
|
||||
if (!res)
|
||||
{
|
||||
checks.ToLower();
|
||||
res = stat(checks, &info) == 0;
|
||||
if (!res)
|
||||
{
|
||||
checks.ToUpper();
|
||||
res = stat(checks, &info) == 0;
|
||||
if (!res) checks = file;
|
||||
}
|
||||
}
|
||||
file = checks;
|
||||
#endif
|
||||
|
||||
if (check && !DirEntryExists(file))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue