summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-03-01 15:02:40 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-03-01 15:02:40 -0500
commit12bb6e2cd377d3dfa2f7ec037c31463c3f9070d1 (patch)
treee3311ad77bd0fb768adcdce7582397cf97f40183 /util.c
parent2d327302b30bf67a87538dc5e005c0399c0b8f1a (diff)
restore session
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) {