From c901edbfb969972802252e4203f18f371f054d95 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sat, 4 Oct 2025 10:42:20 -0500 Subject: [PATCH] Interpret an empty JANET_PATH as unset This is a common idiom with environment variables, where a variable set to the empty string should behave the same as an unset variable. --- src/boot/boot.janet | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/boot/boot.janet b/src/boot/boot.janet index f50ef7de..0d96008d 100644 --- a/src/boot/boot.janet +++ b/src/boot/boot.janet @@ -4634,11 +4634,12 @@ (var expect-image false) (when-let [jp (getenv-alias "JANET_PATH")] - (def path-sep (if (index-of (os/which) [:windows :mingw]) ";" ":")) - (def paths (reverse! (string/split path-sep jp))) - (for i 1 (length paths) - (module/add-syspath (get paths i))) - (setdyn *syspath* (first paths))) + (unless (empty? jp) + (def path-sep (if (index-of (os/which) [:windows :mingw]) ";" ":")) + (def paths (reverse! (string/split path-sep jp))) + (for i 1 (length paths) + (module/add-syspath (get paths i))) + (setdyn *syspath* (first paths)))) (if-let [jprofile (getenv-alias "JANET_PROFILE")] (setdyn *profilepath* jprofile)) (set colorize (and (not (getenv-alias "NO_COLOR"))