diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-03-16 14:05:30 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-03-16 14:05:30 -0400 |
| commit | 5e85306edb4cfd1495df35c98a2a3fd03afe7b15 (patch) | |
| tree | 15eb3bc5f999145d78a1f251a57897d167199ac7 /stdlib | |
| parent | b0b3a5f95a70c25a1dcaa43b7a1fb44c782b35c0 (diff) | |
Bugfix for relative_to()
Diffstat (limited to 'stdlib')
| -rw-r--r-- | stdlib/paths.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/stdlib/paths.c b/stdlib/paths.c index fe4bde2e..35eb5c60 100644 --- a/stdlib/paths.c +++ b/stdlib/paths.c @@ -146,15 +146,15 @@ public Path_t Path$relative_to(Path_t path, Path_t relative_to) for (; shared < path.components.length && shared < relative_to.components.length; shared++) { Text_t *p = (Text_t*)(path.components.data + shared*path.components.stride); Text_t *r = (Text_t*)(relative_to.components.data + shared*relative_to.components.stride); - printf("%ld shared: %k vs %r\n", p, r); if (!Text$equal_values(*p, *r)) break; } - for (int64_t i = shared; i < relative_to.components.length; shared++) + printf("%ld shared!\n", shared); + for (int64_t i = shared; i < relative_to.components.length; i++) Array$insert_value(&result.components, Text(".."), I(1), sizeof(Text_t)); - for (int64_t i = shared; i < path.components.length; shared++) { + for (int64_t i = shared; i < path.components.length; i++) { Text_t *p = (Text_t*)(path.components.data + i*path.components.stride); Array$insert(&result.components, p, I(0), sizeof(Text_t)); } |
