mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Update path.odin
Fix allocator usage for `rel_current` and `rel_between`
This commit is contained in:
+2
-2
@@ -81,7 +81,7 @@ ext :: proc(path: string, new := false, allocator := context.allocator) -> strin
|
|||||||
rel :: proc{rel_between, rel_current};
|
rel :: proc{rel_between, rel_current};
|
||||||
|
|
||||||
// returns the relative path from one path to another
|
// 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 "";
|
if from == "" || to == "" do return "";
|
||||||
|
|
||||||
from = full(from, context.temp_allocator);
|
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
|
// returns the relative path from the current directory to another path
|
||||||
rel_current :: proc(to: string, allocator := context.temp_allocator) -> string {
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user