mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-28 12:30:46 +00:00
- Amend 9d84f92c0e
to just do true case-insensitivity.
* adding /home/mrichters/.config/raze/Blood/sOuNdS.rFf, 1747 lumps
This commit is contained in:
parent
9d84f92c0e
commit
be42a6e28d
1 changed files with 28 additions and 13 deletions
|
@ -42,7 +42,6 @@
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fnmatch.h>
|
#include <fnmatch.h>
|
||||||
#include <sys/stat.h>
|
|
||||||
|
|
||||||
#include "cmdlib.h"
|
#include "cmdlib.h"
|
||||||
|
|
||||||
|
@ -211,22 +210,38 @@ bool D_AddFile(TArray<FString>& wadfiles, const char* file, bool check, int posi
|
||||||
FString basepath = fullpath.Left(lastindex);
|
FString basepath = fullpath.Left(lastindex);
|
||||||
FString filename = fullpath.Right(fullpath.Len() - lastindex - 1);
|
FString filename = fullpath.Right(fullpath.Len() - lastindex - 1);
|
||||||
|
|
||||||
struct stat info;
|
if (filename.IsNotEmpty())
|
||||||
bool res = stat(fullpath, &info) == 0;
|
|
||||||
if (!res)
|
|
||||||
{
|
{
|
||||||
filename.ToLower();
|
bool found = false;
|
||||||
fullpath = basepath << "/" << filename;
|
DIR *d;
|
||||||
res = stat(fullpath, &info) == 0;
|
struct dirent *dir;
|
||||||
if (!res)
|
d = opendir(basepath.GetChars());
|
||||||
|
if (d)
|
||||||
{
|
{
|
||||||
filename.ToUpper();
|
while ((dir = readdir(d)) != NULL)
|
||||||
fullpath = basepath << "/" << filename;
|
{
|
||||||
res = stat(fullpath, &info) == 0;
|
if (filename.CompareNoCase(dir->d_name) == 0)
|
||||||
if (!res) fullpath = file;
|
{
|
||||||
|
found = true;
|
||||||
|
filename = dir->d_name;
|
||||||
|
fullpath = basepath << "/" << filename;
|
||||||
|
file = fullpath.GetChars();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir(d);
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
Printf("Can't find file '%s'\n", filename.GetChars());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Printf("Can't open directory '%s'\n", basepath.GetChars());
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file = fullpath;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (check && !DirEntryExists(file))
|
if (check && !DirEntryExists(file))
|
||||||
|
|
Loading…
Reference in a new issue