From 6dffe84f67bcb31d1beb5561e028c37914bce630 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sat, 17 Aug 2019 22:42:59 -0700 Subject: [PATCH] Fix drive-letter relative path log path (#221) --- Source/multi.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/multi.cpp b/Source/multi.cpp index 30c52ac90..a76dc3e5f 100644 --- a/Source/multi.cpp +++ b/Source/multi.cpp @@ -47,8 +47,10 @@ void __cdecl dumphist(const char *pszFmt, ...) va_start(va, pszFmt); - if (sgpHistFile == NULL) { - sgpHistFile = fopen("c:\\dumphist.txt", "wb"); + char dumpHistPath[MAX_PATH] = {}; + if (sgpHistFile == NULL && GetWindowsDirectory(dumpHistPath, sizeof(dumpHistPath))) { + strcat(dumpHistPath, "\\dumphist.txt"); + sgpHistFile = fopen(dumpHistPath, "wb"); if (sgpHistFile == NULL) { return; }