diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2022-06-28 22:44:14 +0200 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2022-06-28 22:44:14 +0200 |
| commit | 7b166968f34b077850699ff5d4aa5f604615cbee (patch) | |
| tree | 0e9878ffae8d6bc70035cb510d3c28b74f28a71c | |
| parent | 352221c8688e47364b0fa6c4e436f3e0a2dfc131 (diff) | |
| parent | 0f780f6c0bc61294f735f2ccb7209226121e5918 (diff) | |
Merge branch 'master' of github.com:DanielGavin/ols
| -rw-r--r-- | src/common/util_windows.odin | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/common/util_windows.odin b/src/common/util_windows.odin index 194bd4d..716d4be 100644 --- a/src/common/util_windows.odin +++ b/src/common/util_windows.odin @@ -32,10 +32,10 @@ get_case_sensitive_path :: proc(path: string, allocator := context.temp_allocato file := win32.CreateFileW(&wide[0], 0, win32.FILE_SHARE_READ, nil, win32.OPEN_EXISTING, win32.FILE_FLAG_BACKUP_SEMANTICS, nil) if(file == win32.INVALID_HANDLE) - { + { log_last_error() - return ""; - } + return ""; + } buffer := make([]u16, 512, context.temp_allocator) @@ -43,6 +43,8 @@ get_case_sensitive_path :: proc(path: string, allocator := context.temp_allocato res, _ := win32.utf16_to_utf8(buffer[4:], allocator) + win32.CloseHandle(file) + return res } @@ -127,4 +129,4 @@ run_executable :: proc(command: string, stdout: ^[]byte) -> (u32, bool, []byte) win32.CloseHandle(stdout_read) return exit_code, true, stdout[0:index] -}
\ No newline at end of file +} |