update core:filepath's clean, join and split_list to return optional Allocator_Errors

This commit is contained in:
jason
2024-08-16 01:48:27 -04:00
parent 0f052dbde7
commit 07a9c69714
5 changed files with 45 additions and 37 deletions
+3 -3
View File
@@ -39,15 +39,15 @@ abs :: proc(path: string, allocator := context.allocator) -> (string, bool) {
return path_str, true
}
join :: proc(elems: []string, allocator := context.allocator) -> string {
join :: proc(elems: []string, allocator := context.allocator) -> (joined: string, err: runtime.Allocator_Error) #optional_allocator_error {
for e, i in elems {
if e != "" {
runtime.DEFAULT_TEMP_ALLOCATOR_TEMP_GUARD(ignore = context.temp_allocator == allocator)
p := strings.join(elems[i:], SEPARATOR_STRING, context.temp_allocator)
p := strings.join(elems[i:], SEPARATOR_STRING, context.temp_allocator) or_return
return clean(p, allocator)
}
}
return ""
return "", nil
}
@(private)