From 3f890334ef1dac44d936229aa81936f82c84ddc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Thu, 9 Jul 2026 17:37:27 +0200 Subject: [PATCH] fix: migrate from shell-words to shlex for shell parsing --- Cargo.lock | 14 +++++++------- Cargo.toml | 2 +- src/env.rs | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 488f6f647a..45c5783961 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -311,7 +311,7 @@ dependencies = [ "find-msvc-tools", "jobserver", "libc", - "shlex", + "shlex 1.3.0", ] [[package]] @@ -881,7 +881,7 @@ dependencies = [ "riscv", "sbi-rt", "semihosting", - "shell-words", + "shlex 2.0.1", "simple-shell", "smallvec", "smoltcp", @@ -1726,16 +1726,16 @@ dependencies = [ ] [[package]] -name = "shell-words" -version = "1.1.1" +name = "shlex" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6fe69c597f9c37bfeeeeeb33da3530379845f10be461a66d16d03eca2ded77" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "shlex" -version = "1.3.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" [[package]] name = "simple-shell" diff --git a/Cargo.toml b/Cargo.toml index 467138ff40..5533c95c80 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -341,7 +341,7 @@ num_enum = { version = "0.7", default-features = false } pci-ids = { version = "0.2", optional = true } pci_types = { version = "0.10" } rand_chacha = { version = "0.10", default-features = false } -shell-words = { version = "1.1", default-features = false } +shlex = { version = "2", default-features = false } simple-shell = { version = "0.0.1", optional = true } smallvec = { version = "1", features = ["const_new"] } take-static = "0.1" diff --git a/src/env.rs b/src/env.rs index 17cd879576..963cd5f592 100644 --- a/src/env.rs +++ b/src/env.rs @@ -13,6 +13,7 @@ use hashbrown::hash_map::Iter; use hermit_entry::boot_info::{BootInfo, RawBootInfo}; use hermit_sync::OnceCell; use memory_addresses::PhysAddr; +use shlex::Shlex; static BOOT_INFO: OnceCell = OnceCell::new(); @@ -141,9 +142,8 @@ impl Default for Cli { let args = fdt_args().unwrap_or_default(); info!("bootargs = {args}"); - let words = shell_words::split(args).unwrap(); + let mut words = Shlex::new(args); - let mut words = words.into_iter(); let expect_arg = |arg: Option, name: &str| { arg.unwrap_or_else(|| { panic!("The argument '{name}' requires a value but none was supplied")