mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-14 20:00: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__
|
#ifdef __unix__
|
||||||
// Test case sensitively, pure lowercase and pure uppercase.
|
// 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;
|
struct stat info;
|
||||||
bool res = stat(file, &info) == 0;
|
bool res = stat(fullpath, &info) == 0;
|
||||||
if (!res)
|
if (!res)
|
||||||
{
|
{
|
||||||
checks.ToLower();
|
filename.ToLower();
|
||||||
res = stat(checks, &info) == 0;
|
fullpath = basepath << "/" << filename;
|
||||||
|
res = stat(fullpath, &info) == 0;
|
||||||
if (!res)
|
if (!res)
|
||||||
{
|
{
|
||||||
checks.ToUpper();
|
filename.ToUpper();
|
||||||
res = stat(checks, &info) == 0;
|
fullpath = basepath << "/" << filename;
|
||||||
if (!res) checks = file;
|
res = stat(fullpath, &info) == 0;
|
||||||
|
if (!res) fullpath = file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file = checks;
|
file = fullpath;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (check && !DirEntryExists(file))
|
if (check && !DirEntryExists(file))
|
||||||
|
|
Loading…
Reference in a new issue