Fix logfiles crashing Windoze

This commit is contained in:
Jaime Passos 2019-12-28 22:14:23 -03:00
parent f83d0fe3a1
commit 3bb7fd4cbf
1 changed files with 6 additions and 3 deletions

View File

@ -197,9 +197,12 @@ int main(int argc, char **argv)
format, timeinfo);
}
M_MkdirEachUntil(logfilename,
M_PathParts(logdir) - 1,
M_PathParts(logfilename) - 1, 0755);
if (logdir)
{
M_MkdirEachUntil(logfilename,
M_PathParts(logdir) - 1,
M_PathParts(logfilename) - 1, 0755);
}
#ifdef __unix__
logstream = fopen(logfilename, "w");