Fix logfiles crashing Windoze

(cherry picked from commit 3bb7fd4cbf2bb92f5548cafad00b80cb366395a4)
This commit is contained in:
Jaime Passos 2019-12-28 22:14:23 -03:00 committed by James R
parent 7ef8e81713
commit f74adb0ad9

View file

@ -195,9 +195,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");