summaryrefslogtreecommitdiffstats
path: root/src/path.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/path.c')
-rw-r--r--src/path.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/path.c b/src/path.c
index aedf059..7568100 100644
--- a/src/path.c
+++ b/src/path.c
@@ -182,6 +182,10 @@ ZIX_PURE_FUNC
static ZixIndexRange
zix_path_filename_range(const ZixStringView path)
{
+ if (!path.length) {
+ return zix_make_range(0, 0);
+ }
+
// Find the first filename character (skip leading root path if any)
const size_t begin = zix_path_root_path_range(path.data).end;
if (begin == path.length || is_dir_sep(path.data[path.length - 1U])) {