summaryrefslogtreecommitdiffhomepage
path: root/compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'compat.c')
-rw-r--r--compat.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/compat.c b/compat.c
index 7e0c1ac..a689a14 100644
--- a/compat.c
+++ b/compat.c
@@ -193,6 +193,10 @@ int daemon(int nochdir, int noclose) {
char *basename(const char *path) {
char *foo = strrchr(path, '/');
+ if (!foo)
+ {
+ return path;
+ }
return ++foo;
}