Only check if the directory is not empty, use strncasecmp for case insensitive comparing, and remove debug print

This commit is contained in:
Steel Titanium 2020-01-31 20:21:09 -05:00
parent 7c83e5e420
commit a2c15c5cb2
No known key found for this signature in database
GPG Key ID: 924BA411F18DFDBE
1 changed files with 6 additions and 9 deletions

View File

@ -1691,7 +1691,7 @@ W_VerifyName (const char *name, lumpchecklist_t *checklist, boolean status)
size_t j;
for (j = 0; checklist[j].len && checklist[j].name; ++j)
{
if (( strncmp(name, checklist[j].name,
if (( strncasecmp(name, checklist[j].name,
checklist[j].len) != false ) == status)
{
return true;
@ -1803,20 +1803,13 @@ W_VerifyPK3 (FILE *fp, lumpchecklist_t *checklist, boolean status)
if (fgets(fullname, zentry.namelen + 1, fp) != fullname)
return true;
// Check for folders first, if it's blacklisted it will return false
if (W_VerifyName(fullname, folderblacklist, status))
{
CONS_Printf("Blacklisted folder found - %s\n", fullname);
return false;
}
// Strip away file address and extension for the 8char name.
if ((trimname = strrchr(fullname, '/')) != 0)
trimname++;
else
trimname = fullname; // Care taken for root files.
if (*trimname) // Ignore directories
if (*trimname) // Ignore directories, well kinda
{
if ((dotpos = strrchr(trimname, '.')) == 0)
dotpos = fullname + strlen(fullname); // Watch for files without extension.
@ -1826,6 +1819,10 @@ W_VerifyPK3 (FILE *fp, lumpchecklist_t *checklist, boolean status)
if (! W_VerifyName(lumpname, checklist, status))
return false;
// Check for directories next, if it's blacklisted it will return false
if (W_VerifyName(fullname, folderblacklist, status))
return false;
}
free(fullname);