summaryrefslogtreecommitdiff
path: root/path.c
diff options
context:
space:
mode:
Diffstat (limited to 'path.c')
-rw-r--r--path.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/path.c b/path.c
index 4260952..af27161 100644
--- a/path.c
+++ b/path.c
@@ -311,8 +311,10 @@ const char *make_absolute_path(const char *path)
if (last_slash) {
*last_slash = '\0';
last_elem = xstrdup(last_slash + 1);
- } else
+ } else {
last_elem = xstrdup(buf);
+ *buf = '\0';
+ }
}
if (*buf) {