mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 11:22:18 -04:00
if base dir is not found, do not check sub dirs
This commit is contained in:
parent
7e46bed40a
commit
0c7725ae6e
@ -37,14 +37,14 @@ static int FileLength(int descriptor)
|
||||
return st.st_size;
|
||||
}
|
||||
|
||||
static void W_FILE_AddDir(w_handle_t handle, const char *path,
|
||||
static boolean W_FILE_AddDir(w_handle_t handle, const char *path,
|
||||
const char *start_marker, const char *end_marker)
|
||||
{
|
||||
int startlump = numlumps;
|
||||
|
||||
glob_t *glob;
|
||||
|
||||
if (!strcmp(path, "."))
|
||||
if (path[0] == '.')
|
||||
{
|
||||
glob = I_StartGlob(handle.p1.base_path, "*.*",
|
||||
GLOB_FLAG_NOCASE | GLOB_FLAG_SORTED);
|
||||
@ -58,7 +58,7 @@ static void W_FILE_AddDir(w_handle_t handle, const char *path,
|
||||
|
||||
if (!glob)
|
||||
{
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
while (true)
|
||||
@ -103,6 +103,8 @@ static void W_FILE_AddDir(w_handle_t handle, const char *path,
|
||||
{
|
||||
W_AddMarker(end_marker);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static int *descriptors = NULL;
|
||||
|
@ -25,7 +25,7 @@ typedef enum
|
||||
|
||||
typedef struct w_module_s
|
||||
{
|
||||
void (*AddDir)(w_handle_t handle, const char *path,
|
||||
boolean (*AddDir)(w_handle_t handle, const char *path,
|
||||
const char *start_marker, const char *end_marker);
|
||||
w_type_t (*Open)(const char *path, w_handle_t *handle);
|
||||
void (*Read)(w_handle_t handle, void *dest, int size);
|
||||
|
@ -129,7 +129,10 @@ static w_module_t *modules[] =
|
||||
|
||||
static void AddDirs(w_module_t *module, w_handle_t handle, const char *base)
|
||||
{
|
||||
module->AddDir(handle, base, NULL, NULL);
|
||||
if (!module->AddDir(handle, base, NULL, NULL))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < arrlen(subdirs); ++i)
|
||||
{
|
||||
|
@ -101,7 +101,7 @@ static void AddWadInMem(mz_zip_archive *zip, const char *name, int index,
|
||||
}
|
||||
}
|
||||
|
||||
static void W_ZIP_AddDir(w_handle_t handle, const char *path,
|
||||
static boolean W_ZIP_AddDir(w_handle_t handle, const char *path,
|
||||
const char *start_marker, const char *end_marker)
|
||||
{
|
||||
mz_zip_archive *zip = handle.p1.zip;
|
||||
@ -121,7 +121,7 @@ static void W_ZIP_AddDir(w_handle_t handle, const char *path,
|
||||
|
||||
if (index < 0)
|
||||
{
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
++index;
|
||||
@ -185,6 +185,8 @@ static void W_ZIP_AddDir(w_handle_t handle, const char *path,
|
||||
{
|
||||
W_AddMarker(end_marker);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static mz_zip_archive **zips = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user