mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
multi-dir patch for fs_sharepath from "Alexey I.Froloff" <raorn@altlinux.ru>
This commit is contained in:
parent
82b389a720
commit
66e203b16b
1 changed files with 23 additions and 4 deletions
|
@ -1133,13 +1133,32 @@ QFS_AddDirectory (const char *dir)
|
|||
static void
|
||||
QFS_AddGameDirectory (const char *dir)
|
||||
{
|
||||
const char *e;
|
||||
const char *s;
|
||||
dstring_t *s_dir;
|
||||
|
||||
if (!*dir)
|
||||
return;
|
||||
Sys_DPrintf ("QFS_AddGameDirectory (\"%s/%s\")\n",
|
||||
fs_sharepath->string, dir);
|
||||
e = fs_sharepath->string + strlen (fs_sharepath->string);
|
||||
s = e;
|
||||
s_dir = dstring_new ();
|
||||
|
||||
if (strcmp (fs_sharepath->string, fs_userpath->string) != 0)
|
||||
QFS_AddDirectory (va ("%s/%s", fs_sharepath->string, dir));
|
||||
while (s >= fs_sharepath->string) {
|
||||
while (s != fs_sharepath->string && s[-1] !=':')
|
||||
s--;
|
||||
if (s != e) {
|
||||
dsprintf (s_dir, "%.*s", (int) (e - s), s);
|
||||
if (strcmp (s_dir->str, fs_userpath->string) != 0) {
|
||||
Sys_DPrintf ("QFS_AddGameDirectory (\"%s/%s\")\n",
|
||||
s_dir->str, dir);
|
||||
|
||||
QFS_AddDirectory (va ("%s/%s", s_dir->str, dir));
|
||||
}
|
||||
}
|
||||
e = --s;
|
||||
}
|
||||
|
||||
Sys_DPrintf ("QFS_AddGameDirectory (\"%s/%s\")\n", qfs_userpath, dir);
|
||||
QFS_AddDirectory (va ("%s/%s", qfs_userpath, dir));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue