Implement folder blacklisting
This commit is contained in:
parent
4238003887
commit
7c83e5e420
19
src/w_wad.c
19
src/w_wad.c
|
@ -1746,6 +1746,18 @@ W_VerifyWAD (FILE *fp, lumpchecklist_t *checklist, boolean status)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// List of blacklisted folders to use when checking the PK3
|
||||||
|
static lumpchecklist_t folderblacklist[] =
|
||||||
|
{
|
||||||
|
{"Lua/", 4},
|
||||||
|
{"SOC/", 4},
|
||||||
|
{"Sprites/", 8},
|
||||||
|
{"Textures/", 9},
|
||||||
|
{"Patches/", 8},
|
||||||
|
{"Flats/", 6},
|
||||||
|
{"Fades/", 6}
|
||||||
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
W_VerifyPK3 (FILE *fp, lumpchecklist_t *checklist, boolean status)
|
W_VerifyPK3 (FILE *fp, lumpchecklist_t *checklist, boolean status)
|
||||||
{
|
{
|
||||||
|
@ -1791,6 +1803,13 @@ W_VerifyPK3 (FILE *fp, lumpchecklist_t *checklist, boolean status)
|
||||||
if (fgets(fullname, zentry.namelen + 1, fp) != fullname)
|
if (fgets(fullname, zentry.namelen + 1, fp) != fullname)
|
||||||
return true;
|
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.
|
// Strip away file address and extension for the 8char name.
|
||||||
if ((trimname = strrchr(fullname, '/')) != 0)
|
if ((trimname = strrchr(fullname, '/')) != 0)
|
||||||
trimname++;
|
trimname++;
|
||||||
|
|
Loading…
Reference in New Issue