Simplify case insensitive lookups

This commit is contained in:
Kp 2018-06-13 02:02:58 +00:00
parent d5bfeb0813
commit 5526de4c10
2 changed files with 3 additions and 4 deletions

View file

@ -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)

View file

@ -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