mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-14 11:50:49 +00:00
- Amend bce15428d5
to only check case on the filename, not the full path.
* Still to be tested when I get home, but need it committed to get it off my laptop anyway.
This commit is contained in:
parent
25d79285a3
commit
9d84f92c0e
1 changed files with 14 additions and 8 deletions
|
@ -206,21 +206,27 @@ bool D_AddFile(TArray<FString>& wadfiles, const char* file, bool check, int posi
|
|||
}
|
||||
#ifdef __unix__
|
||||
// Test case sensitively, pure lowercase and pure uppercase.
|
||||
FString checks = file;
|
||||
FString fullpath = file;
|
||||
auto lastindex = fullpath.LastIndexOf("/");
|
||||
FString basepath = fullpath.Left(lastindex);
|
||||
FString filename = fullpath.Right(fullpath.Len() - lastindex - 1);
|
||||
|
||||
struct stat info;
|
||||
bool res = stat(file, &info) == 0;
|
||||
bool res = stat(fullpath, &info) == 0;
|
||||
if (!res)
|
||||
{
|
||||
checks.ToLower();
|
||||
res = stat(checks, &info) == 0;
|
||||
filename.ToLower();
|
||||
fullpath = basepath << "/" << filename;
|
||||
res = stat(fullpath, &info) == 0;
|
||||
if (!res)
|
||||
{
|
||||
checks.ToUpper();
|
||||
res = stat(checks, &info) == 0;
|
||||
if (!res) checks = file;
|
||||
filename.ToUpper();
|
||||
fullpath = basepath << "/" << filename;
|
||||
res = stat(fullpath, &info) == 0;
|
||||
if (!res) fullpath = file;
|
||||
}
|
||||
}
|
||||
file = checks;
|
||||
file = fullpath;
|
||||
#endif
|
||||
|
||||
if (check && !DirEntryExists(file))
|
||||
|
|
Loading…
Reference in a new issue