Improve default temp allocator; Fix filepath.abs behaviour on Windows

This commit is contained in:
gingerBill
2020-10-13 14:40:13 +01:00
parent 1b4bccbc94
commit fa33476438
5 changed files with 59 additions and 38 deletions
+3 -3
View File
@@ -124,7 +124,7 @@ clean :: proc(path: string, allocator := context.allocator) -> string {
r, dot_dot := 0, 0;
if rooted {
lazy_buffer_append(out, '/');
lazy_buffer_append(out, SEPARATOR);
r, dot_dot = 1, 1;
}
@@ -144,7 +144,7 @@ clean :: proc(path: string, allocator := context.allocator) -> string {
}
case !rooted:
if out.w > 0 {
lazy_buffer_append(out, '/');
lazy_buffer_append(out, SEPARATOR);
}
lazy_buffer_append(out, '.');
lazy_buffer_append(out, '.');
@@ -152,7 +152,7 @@ clean :: proc(path: string, allocator := context.allocator) -> string {
}
case:
if rooted && out.w != 1 || !rooted && out.w != 0 {
lazy_buffer_append(out, '/');
lazy_buffer_append(out, SEPARATOR);
}
for ; r < n && !is_separator(path[r]); r += 1 {
lazy_buffer_append(out, path[r]);