aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vis.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/vis.c b/vis.c
index dc2c984..b689e6f 100644
--- a/vis.c
+++ b/vis.c
@@ -160,8 +160,10 @@ static char *absolute_path(const char *name) {
char *base = basename(copy2);
if (!(path_absolute = realpath(dir, NULL)))
goto err;
+ if (strcmp(path_absolute, "/") == 0)
+ path_absolute[0] = '\0';
- snprintf(path_normalized, sizeof(path_normalized)-1, "%s/%s",
+ snprintf(path_normalized, sizeof(path_normalized), "%s/%s",
path_absolute, base);
err:
free(copy1);