From 045f98869265fa88a8e4133bd24b23f2744da514 Mon Sep 17 00:00:00 2001 From: Mykhailo Chalyi Date: Mon, 30 Mar 2026 20:44:08 +0000 Subject: [PATCH 1/2] fix(interpreter): get_ifs_separator respects local IFS get_ifs_separator() only checked self.variables for IFS, missing local IFS declarations stored in call_stack.locals. This caused local IFS=":" to have no effect on "${arr[*]}" array joining. Fix: use expand_variable("IFS") which checks locals first. --- crates/bashkit/src/interpreter/mod.rs | 13 ++++++++----- crates/bashkit/src/lib.rs | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/crates/bashkit/src/interpreter/mod.rs b/crates/bashkit/src/interpreter/mod.rs index 1a821f40..e243c323 100644 --- a/crates/bashkit/src/interpreter/mod.rs +++ b/crates/bashkit/src/interpreter/mod.rs @@ -7980,13 +7980,16 @@ impl Interpreter { /// Get the separator for `[*]` array joins: first char of IFS, or space if IFS unset. fn get_ifs_separator(&self) -> String { - match self.variables.get("IFS") { - Some(ifs) => ifs - .chars() + let ifs = self.expand_variable("IFS"); + if ifs.is_empty() && !self.is_variable_set("IFS") { + // IFS unset: default separator is space + " ".to_string() + } else { + // IFS set (possibly empty): first char or empty + ifs.chars() .next() .map(|c| c.to_string()) - .unwrap_or_default(), - None => " ".to_string(), + .unwrap_or_default() } } diff --git a/crates/bashkit/src/lib.rs b/crates/bashkit/src/lib.rs index dbb21ec8..7e52e4d4 100644 --- a/crates/bashkit/src/lib.rs +++ b/crates/bashkit/src/lib.rs @@ -2485,6 +2485,26 @@ fn assert_eq!(result.stdout, "test\n"); } + #[tokio::test] + async fn test_local_ifs_array_join() { + // Regression: local IFS=":" must affect "${arr[*]}" joining + let mut bash = Bash::new(); + let result = bash + .exec( + r#" +fn() { + local arr=(a b c) + local IFS=":" + echo "${arr[*]}" +} +fn +"#, + ) + .await + .unwrap(); + assert_eq!(result.stdout, "a:b:c\n"); + } + #[tokio::test] async fn test_glob_star() { let mut bash = Bash::new(); From 0e4663e4f3e266ba7587bed5a75e80859fc81d40 Mon Sep 17 00:00:00 2001 From: Mykhailo Chalyi Date: Mon, 30 Mar 2026 23:23:17 +0000 Subject: [PATCH 2/2] chore(supply-chain): update insta exemption to 1.47.2 --- supply-chain/config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supply-chain/config.toml b/supply-chain/config.toml index 17755864..699afa47 100644 --- a/supply-chain/config.toml +++ b/supply-chain/config.toml @@ -575,7 +575,7 @@ version = "2.13.0" criteria = "safe-to-deploy" [[exemptions.insta]] -version = "1.47.1" +version = "1.47.2" criteria = "safe-to-run" [[exemptions.instant]]