mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-20 09:52:18 +00:00
Only check if the directory is not empty, use strncasecmp for case insensitive comparing, and remove debug print
This commit is contained in:
parent
7c83e5e420
commit
a2c15c5cb2
1 changed files with 6 additions and 9 deletions
15
src/w_wad.c
15
src/w_wad.c
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue