Simplify case insensitive lookups
This commit is contained in:
parent
d5bfeb0813
commit
5526de4c10
|
@ -73,8 +73,8 @@ public:
|
|||
|
||||
static int locateOneElement(char *const sptr, char *const ptr, const char *buf)
|
||||
{
|
||||
if (PHYSFS_exists(buf))
|
||||
return(1); /* quick rejection: exists in current case. */
|
||||
if (const auto r = PHYSFS_exists(buf))
|
||||
return r; /* quick rejection: exists in current case. */
|
||||
|
||||
search_result_t rc{ptr, buf};
|
||||
range_for (const auto i, rc)
|
||||
|
|
|
@ -510,8 +510,7 @@ int PHYSFSX_exists_ignorecase(const char *filename)
|
|||
{
|
||||
char filename2[PATH_MAX];
|
||||
snprintf(filename2, sizeof(filename2), "%s", filename);
|
||||
PHYSFSEXT_locateCorrectCase(filename2);
|
||||
return PHYSFS_exists(filename2);
|
||||
return !PHYSFSEXT_locateCorrectCase(filename2);
|
||||
}
|
||||
|
||||
//Open a file for reading, set up a buffer
|
||||
|
|
Loading…
Reference in a new issue