ensure the path passed to Sys_DebugLog is expanded

This commit is contained in:
Bill Currie 2003-03-13 05:41:55 +00:00
parent 6a79ee57c4
commit e105198f48

View file

@ -481,6 +481,9 @@ Sys_DebugLog (const char *file, const char *fmt, ...)
va_list args;
static dstring_t *data;
int fd;
char path[PATH_MAX];
Qexpand_squiggle (file, path);
if (!data)
data = dstring_newstr ();
@ -488,7 +491,7 @@ Sys_DebugLog (const char *file, const char *fmt, ...)
va_start (args, fmt);
dvsprintf (data, fmt, args);
va_end (args);
fd = open (file, O_WRONLY | O_CREAT | O_APPEND, 0666);
fd = open (path, O_WRONLY | O_CREAT | O_APPEND, 0666);
write (fd, data->str, data->size - 1);
close (fd);
}