summaryrefslogtreecommitdiffstats
path: root/src/path.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-02-04 19:25:22 -0500
committerDavid Robillard <d@drobilla.net>2023-02-04 19:25:22 -0500
commit5a9787b4247c6735cc3213944945e8983002edf9 (patch)
tree635a8711a53b9e50d7dcd24dc4acefefce694c3d /src/path.c
parentc4b3814edad510c6c124089822bd5506f9334411 (diff)
downloadzix-5a9787b4247c6735cc3213944945e8983002edf9.tar.gz
zix-5a9787b4247c6735cc3213944945e8983002edf9.tar.bz2
zix-5a9787b4247c6735cc3213944945e8983002edf9.zip
Suppress/fix clang-tidy warnings on Windows
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])) {