aboutsummaryrefslogtreecommitdiff
path: root/src/path.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/path.c')
-rw-r--r--src/path.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/path.c b/src/path.c
index c9160bb..090727d 100644
--- a/src/path.c
+++ b/src/path.c
@@ -16,6 +16,9 @@ char *ct_basename(const char *file)
break;
}
+ if (n == 0)
+ return strdup(file);
+
return strndup(file + n + 1, l - n);
}