aboutsummaryrefslogtreecommitdiff
path: root/src/path.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-03-07 16:39:44 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2023-03-07 16:39:44 +0200
commit70615379062cdd2e016f5095dfafd23a6dca148c (patch)
tree4d8c2ed62e44de524f00f39f31d0f5662fc7dcfe /src/path.c
parentae5fee63f160643a397d18e9e0658275606bc4d4 (diff)
downloadek-70615379062cdd2e016f5095dfafd23a6dca148c.tar.gz
ek-70615379062cdd2e016f5095dfafd23a6dca148c.zip
add initial import detection
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);
}