From 7e4240a460577225d83e4c69a8eca543215263b4 Mon Sep 17 00:00:00 2001 From: juaum Date: Thu, 16 Apr 2026 15:11:40 +0200 Subject: [PATCH] Fix os.stem on empty path --- core/os/path.odin | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/os/path.odin b/core/os/path.odin index 0a0c8356a..22ec2d3f7 100644 --- a/core/os/path.odin +++ b/core/os/path.odin @@ -413,10 +413,15 @@ e.g. 'name.tar.gz' -> 'name.tar' 'name.txt' -> 'name' +Returns an empty string if the path is empty Returns an empty string if there is no stem. e.g: '.gitignore'. Returns an empty string if there's a trailing path separator. */ stem :: proc(path: string) -> string { + if path == "" { + return "" + } + // If the last character is a path separator, there is no file. if is_path_separator(path[len(path) - 1]) { return ""