diff options
Diffstat (limited to 'compat.c')
-rw-r--r-- | compat.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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; } |