summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/file.c b/file.c
index efa581d..52622da 100644
--- a/file.c
+++ b/file.c
@@ -138,7 +138,7 @@ file_get_basename(const struct file * f)
/* is the path a basename itself? */
if (strrchr(f->path, '/') == NULL)
- return f->path;
+ return strdup(f->path);
/* get the basename */
return str_tail(f->path, '/');