tweaks per laytan suggestions

This commit is contained in:
Colin Davidson
2024-10-10 09:14:29 -07:00
parent a6502c3e8c
commit 4c8e355444
11 changed files with 33 additions and 42 deletions
+2 -4
View File
@@ -431,7 +431,7 @@ absolute_path_from_handle :: proc(fd: Handle) -> (string, Error) {
}
@(require_results)
absolute_path_from_relative :: proc(rel: string) -> (path: string, err: Error) {
absolute_path_from_relative :: proc(rel: string, allocator := context.allocator) -> (path: string, err: Error) {
rel := rel
if rel == "" {
rel = "."
@@ -447,9 +447,7 @@ absolute_path_from_relative :: proc(rel: string) -> (path: string, err: Error) {
defer _unix_free(path_ptr)
path_cstr := cstring(path_ptr)
path = strings.clone(string(path_cstr))
return path, nil
return strings.clone(string(path_cstr), allocator)
}
access :: proc(path: string, mask: int) -> (bool, Error) {