diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2026-02-20 00:10:12 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2026-02-20 00:10:12 -0500 |
| commit | 92c2eadcf55befba95d461aa0ea8e2feb3664cdc (patch) | |
| tree | bfd385577f20facf3b70f7d69e25dc369adc91d6 | |
| parent | 144c8eaeb8b593560ee418e40567a3e79f6537d2 (diff) | |
Fix concat bugstr-paths
| -rw-r--r-- | src/stdlib/paths.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/stdlib/paths.c b/src/stdlib/paths.c index 92f40bcf..db596b04 100644 --- a/src/stdlib/paths.c +++ b/src/stdlib/paths.c @@ -103,19 +103,7 @@ static OptionalPath_t Path$_concat2(OptionalPath_t a, OptionalPath_t b) { if (a == NULL || b == NULL) return NULL; if (path_type(b) != PATH_RELATIVE) fail("Cannot concatenate an absolute or home-based path onto another path: (", b, ")"); - if (b[0] == '.') { - if (b[1] == '\0') return a; - - // Parent: ".." - if (b[1] == '.') { - if (b[2] == '\0') return Path$parent(a); - else if (b[2] == '/') return Path$_concat2(Path$parent(b), b + 3); - b = b + 2; - } - - if (b[1] == '/') return Path$_concat2(a, b + 2); - } - + if (b[0] == '.' && b[1] == '\0') return a; static char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "%s/%s", a, b); return path_from_buf(buf); |
