0
0
Fork 0
mirror of https://git.code.sf.net/p/quake/quakeforge synced 2025-03-21 18:01:15 +00:00

allow for total subversion of the fs code by utilities (or crazy users).

About the only thing that remains in effect is gzip support (not even paks
are searched).
This commit is contained in:
Bill Currie 2001-07-17 22:10:20 +00:00
parent 3e1bbd47df
commit ffd459c931

View file

@ -591,16 +591,16 @@ _COM_FOpenFile (const char *filename, VFile **gzfile, char *foundname, int zip)
}
} else {
// check a file in the directory tree
snprintf (netpath, sizeof (netpath), "%s/%s", search->filename,
filename);
snprintf (netpath, sizeof (netpath), "%s%s%s", search->filename,
search->filename[0] ? "/" : "", filename);
strncpy (foundname, filename, MAX_OSPATH);
findtime = Sys_FileTime (netpath);
if (findtime == -1) {
#ifdef HAVE_ZLIB
strncpy (foundname, gzfilename, MAX_OSPATH);
snprintf (netpath, sizeof (netpath), "%s/%s", search->filename,
gzfilename);
snprintf (netpath, sizeof (netpath), "%s%s%s", search->filename,
search->filename[0] ? "/" : "", gzfilename);
findtime = Sys_FileTime (netpath);
if (findtime == -1)
#endif
@ -1008,6 +1008,19 @@ COM_Filesystem_Init (void)
{
int i;
if (!fs_sharepath->string[0]
&& !fs_userpath->string[0]
&& !fs_basegame->string[0]) {
// a util (or a silly user:) are subverting the fs code
// add the directory to the search path
searchpath_t *search = calloc (1, sizeof (searchpath_t));
strcpy (search->filename, "");
search->next = com_searchpaths;
com_searchpaths = search;
com_base_searchpaths = com_searchpaths;
return;
}
// start up with basegame->string by default
COM_CreateGameDirectory (fs_basegame->string);