aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-05-27 14:46:10 +0100
committergingerBill <bill@gingerbill.org>2021-05-27 14:46:10 +0100
commit8cfdd9805da4c3ad2d54e7ff40e69e2d8ea81f57 (patch)
tree9aa085d3fa1205f59ae32d95520354331dc8fc07
parent7d304f4e8b3639a721a47867ff0c2a29c3096086 (diff)
parentb65e5d5e034acc6f5d0b0f29deb6e0796ba04971 (diff)
Merge branch 'master' of https://github.com/odin-lang/Odin
-rw-r--r--core/path/filepath/path.odin14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/path/filepath/path.odin b/core/path/filepath/path.odin
index 5ec28c2ec..9f1719f3b 100644
--- a/core/path/filepath/path.odin
+++ b/core/path/filepath/path.odin
@@ -206,23 +206,23 @@ Relative_Error :: enum {
rel :: proc(base_path, target_path: string, allocator := context.allocator) -> (string, Relative_Error) {
context.allocator = allocator;
- base_vol, target_vol := volume_name(base_path), volume_name(target_path);
- base, target := clean(base_path), clean(target_path);
+ base_clean, target_clean := clean(base_path), clean(target_path);
delete_target := true;
defer {
if delete_target {
- delete(target);
+ delete(target_clean);
}
- delete(base);
+ delete(base_clean);
}
- if strings.equal_fold(target, base) {
+ if strings.equal_fold(target_clean, base_clean) {
return strings.clone("."), .None;
}
- base = base[len(base_vol):];
- target = target[len(target_vol):];
+ base_vol, target_vol := volume_name(base_path), volume_name(target_path);
+ base := base_clean[len(base_vol):];
+ target := target_clean[len(target_vol):];
if base == "." {
base = "";
}