Pass correct path specifier to FS_ListFiles().

This prevents Sys_FindFirst() further down below getting called with
wrong arguments, returning a null pointer. The null pointer crashes
the filesystem. :/
This commit is contained in:
Yamagi 2020-10-17 15:18:47 +02:00
parent 6498876c1a
commit f49a7f482f

View file

@ -1830,11 +1830,11 @@ FS_ListMods(int *nummods)
// make sure this Raw path ends with a '/' otherwise FS_ListFiles will open its parent dir
if(search->path[searchpathlength - 1] != '/')
{
Com_sprintf(searchpath, sizeof(searchpath), "%s/", search->path);
Com_sprintf(searchpath, sizeof(searchpath), "%s/*", search->path);
}
else
{
strcpy(searchpath, search->path);
Com_sprintf(searchpath, sizeof(searchpath), "%s*", search->path);
}
dirchildren = FS_ListFiles(searchpath, &numdirchildren, 0, 0);