diff options
Diffstat (limited to 'core/windows.c')
-rw-r--r-- | core/windows.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/core/windows.c b/core/windows.c index 029c3516e..f0b9eb22c 100644 --- a/core/windows.c +++ b/core/windows.c @@ -103,17 +103,16 @@ const char *system_default_directory(void) */ const char *system_default_filename(void) { - static wchar_t filename[UNLEN + 5] = { 0 }; - if (!*filename) { + static const char *path = NULL; + if (!path) { wchar_t username[UNLEN + 1] = { 0 }; DWORD username_len = UNLEN + 1; GetUserNameW(username, &username_len); + wchar_t filename[UNLEN + 5] = { 0 }; wcscat(filename, username); wcscat(filename, L".xml"); - } - static const char *path = NULL; - if (!path) path = system_default_path_append(filename); + } return path; } |