nuke Qexpand_squiggle. instead, expand ~ to $HOME on qfs initialization and

cache the value.

don't call Qopen directly in the engine. instead call QFS_Open (generic) or
QFS_WOpen (write only, zip flag).

rework QFS_NextFilename to use a dstring (avoiding a potential buffer
overflow), support 10000 files and work from the top-level fs_userpath
directory. adjust QFS_WriteFile and QFS_WriteBuffers etc to suit.

make sw32 screenshots actually get written.

hopefully everything gets written to the right places :)
This commit is contained in:
Bill Currie 2003-05-23 17:17:01 +00:00
parent c5be2fb501
commit c2c3a62956
28 changed files with 254 additions and 630 deletions

View file

@ -144,7 +144,7 @@ CF_BuildQuota (void)
if (!path)
path = dstring_new ();
dsprintf (path, "%s/%s/%s", fs_userpath->string, qfs_gamedir->dir.def, CF_DIR);
dsprintf (path, "%s/%s/%s", qfs_userpath, qfs_gamedir->dir.def, CF_DIR);
dir = opendir (path->str);
if (!dir)
@ -227,8 +227,7 @@ CF_Open (const char *path, const char *mode)
return -1;
}
dsprintf (fullpath, "%s/%s/%s/%s", fs_userpath->string,
qfs_gamedir->dir.def, CF_DIR, path);
dsprintf (fullpath, "%s/%s/%s", qfs_gamedir->dir.def, CF_DIR, path);
j = fullpath->str + strlen (fullpath->str) - strlen (path);
for (i = 0; path[i]; i++, j++) // strcpy, but force lowercase
@ -245,7 +244,7 @@ CF_Open (const char *path, const char *mode)
else
oldsize = 0;
file = Qopen (fullpath->str, mode);
file = QFS_Open (fullpath->str, mode);
if (file) {
if (cf_openfiles >= cf_filepcount) {
cf_filepcount++;