summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/util.c b/util.c
index 9ceb4cc..f99524d 100644
--- a/util.c
+++ b/util.c
@@ -260,6 +260,10 @@ static bool path_is_absolute(char const *path) {
// assuming `dir` is an absolute path, returns the absolute path of `relpath`, relative to `dir`.
static void path_full(char const *dir, char const *relpath, char *abspath, size_t abspath_size) {
+ if (path_is_absolute(relpath)) {
+ str_cpy(abspath, abspath_size, relpath);
+ return;
+ }
str_cpy(abspath, abspath_size, dir);
while (1) {