diff options
| author | Mark Naughton <mark@marknaughton.com> | 2023-04-25 12:08:15 +0100 |
|---|---|---|
| committer | Mark Naughton <mark@marknaughton.com> | 2023-04-25 12:08:15 +0100 |
| commit | 5151403aaa500fc7a60c5f234f53d46d0b446b03 (patch) | |
| tree | b44e4c8f848c146d4bd19401fca867f6139e7020 /src/path.cpp | |
| parent | 67b6a8ee89f5138f3e10d1d40111ac755ba34149 (diff) | |
Fix Windows version of get_current_directory
Diffstat (limited to 'src/path.cpp')
| -rw-r--r-- | src/path.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/path.cpp b/src/path.cpp index 414a90c39..7664380a4 100644 --- a/src/path.cpp +++ b/src/path.cpp @@ -33,8 +33,6 @@ gb_internal String remove_directory_from_path(String const &s) { // NOTE(Mark Naughton): getcwd as String
#if !defined(GB_SYSTEM_WINDOWS)
gb_internal String get_current_directory(void) {
- gbAllocator a = heap_allocator();
-
char cwd[256];
getcwd(cwd, 256);
@@ -48,7 +46,9 @@ gb_internal String get_current_directory(void) { wchar_t cwd[256];
GetCurrentDirectoryW(256, cwd);
- return make_string_c(cwd);
+ String16 wstr = make_string16_c(cwd);
+
+ return string16_to_string(a, wstr);
}
#endif
|