Made QFS_NextFilename use Qexpand_squiggle on fs_userpath so screenshots

are saved to sequential filenames correctly.  This might be temporary if
taniwha has a better way of handling squiggle expansion in QFS in mind.
This commit is contained in:
Brian Koropoff 2003-02-16 22:43:06 +00:00
parent f6da3baa1e
commit 7eb2e42a3c

View file

@ -1228,7 +1228,7 @@ int
QFS_NextFilename (char *filename, const char *prefix, const char *ext) QFS_NextFilename (char *filename, const char *prefix, const char *ext)
{ {
char *digits; char *digits;
char checkname[MAX_OSPATH]; char checkname[MAX_OSPATH], exp[MAX_OSPATH];
int i; int i;
strncpy (filename, prefix, MAX_OSPATH - 4); strncpy (filename, prefix, MAX_OSPATH - 4);
@ -1236,13 +1236,14 @@ QFS_NextFilename (char *filename, const char *prefix, const char *ext)
digits = filename + strlen (filename); digits = filename + strlen (filename);
strcat (filename, "000"); strcat (filename, "000");
strncat (filename, ext, MAX_OSPATH - strlen (filename)); strncat (filename, ext, MAX_OSPATH - strlen (filename));
Qexpand_squiggle (fs_userpath->string, exp);
for (i = 0; i <= 999; i++) { for (i = 0; i <= 999; i++) {
digits[0] = i / 100 + '0'; digits[0] = i / 100 + '0';
digits[1] = i / 10 % 10 + '0'; digits[1] = i / 10 % 10 + '0';
digits[2] = i % 10 + '0'; digits[2] = i % 10 + '0';
snprintf (checkname, sizeof (checkname), snprintf (checkname, sizeof (checkname),
"%s/%s/%s", fs_userpath->string, qfs_gamedir->dir.def, "%s/%s/%s", exp, qfs_gamedir->dir.def,
filename); filename);
if (Sys_FileTime (checkname) == -1) if (Sys_FileTime (checkname) == -1)
return 1; // file doesn't exist return 1; // file doesn't exist