diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-05 15:47:00 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-05 15:47:00 -0400 |
| commit | df61a0805fa5a54896c93200832165508e5badfa (patch) | |
| tree | cea44cbc98b60b308e74e612bbadc8fbe938e52e /builtins | |
| parent | 3444d1652d495def1195ab1d9c1fba4543f2af86 (diff) | |
Correctly resolve '../' paths
Diffstat (limited to 'builtins')
| -rw-r--r-- | builtins/files.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtins/files.c b/builtins/files.c index f506d596..dc91d0b0 100644 --- a/builtins/files.c +++ b/builtins/files.c @@ -29,7 +29,7 @@ public char *resolve_path(const char *path, const char *relative_to, const char if (streq(path, "~") || starts_with(path, "~/")) { char *resolved = realpath(heap_strf("%s%s", getenv("HOME"), path+1), buf); if (resolved) return GC_strdup(resolved); - } else if (streq(path, ".") || starts_with(path, "./")) { + } else if (streq(path, ".") || starts_with(path, "./") || starts_with(path, "../")) { char *relative_dir = dirname(GC_strdup(relative_to)); char *resolved = realpath(heap_strf("%s/%s", relative_dir, path), buf); if (resolved) return GC_strdup(resolved); |
