diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2022-07-09 18:36:01 +0200 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2022-07-09 18:36:01 +0200 |
| commit | 28d4e76ecc635c1c386ff914d4db6c92eea092e8 (patch) | |
| tree | e7b181f43a0e65358917988c11ad2e04c0cbeabd /src/common | |
| parent | 9e9f4958f0ff2686cd0ace5a247c54c5ab775106 (diff) | |
| parent | fb5b19056827afbad2133f486d68d2ea162930e7 (diff) | |
Merge branch 'master' into index-caching
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/config.odin | 1 | ||||
| -rw-r--r-- | src/common/util_windows.odin | 10 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/common/config.odin b/src/common/config.odin index 387e8b8..d90e5fa 100644 --- a/src/common/config.odin +++ b/src/common/config.odin @@ -28,6 +28,7 @@ Config :: struct { Format_Config :: struct { tabs: bool, characters: int, + spaces: int, } config: Config;
\ No newline at end of file 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 +} |