Update path.odin

Fix allocator usage for `rel_current` and `rel_between`
This commit is contained in:
Brendan Punsky
2019-03-13 16:38:02 -04:00
committed by GitHub
parent 222e5c8ae9
commit da26e14959

View File

@@ -81,7 +81,7 @@ ext :: proc(path: string, new := false, allocator := context.allocator) -> strin
rel :: proc{rel_between, rel_current};
// returns the relative path from one path to another
rel_between :: proc(from, to: string, allocator := context.temp_allocator) -> string {
rel_between :: proc(from, to: string, allocator := context.allocator) -> string {
if from == "" || to == "" do return "";
from = full(from, context.temp_allocator);
@@ -190,7 +190,7 @@ rel_between :: proc(from, to: string, allocator := context.temp_allocator) -> st
// returns the relative path from the current directory to another path
rel_current :: proc(to: string, allocator := context.temp_allocator) -> string {
return inline rel_between(current(allocator), to);
return inline rel_between(current(context.temp_allocator), to, allocator);
}