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(); 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]]