mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
Remove shell-words and use shlex
This commit is contained in:
7
codex-rs/Cargo.lock
generated
7
codex-rs/Cargo.lock
generated
@@ -976,7 +976,6 @@ dependencies = [
|
||||
"reqwest",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"shell-words",
|
||||
"shlex",
|
||||
"strum 0.27.2",
|
||||
"strum_macros 0.27.2",
|
||||
@@ -4399,12 +4398,6 @@ dependencies = [
|
||||
"lazy_static",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "shell-words"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde"
|
||||
|
||||
[[package]]
|
||||
name = "shlex"
|
||||
version = "1.3.0"
|
||||
|
||||
@@ -60,7 +60,6 @@ regex-lite = "0.1"
|
||||
reqwest = { version = "0.12", features = ["json"] }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = { version = "1", features = ["preserve_order"] }
|
||||
shell-words = "1.1"
|
||||
shlex = "1.3.0"
|
||||
strum = "0.27.2"
|
||||
strum_macros = "0.27.2"
|
||||
|
||||
@@ -9,10 +9,9 @@ pub fn normalize_pasted_path(pasted: &str) -> Option<PathBuf> {
|
||||
}
|
||||
|
||||
// shell-escaped single path → unescaped
|
||||
if let Ok(mut parts) = shell_words::split(pasted) {
|
||||
if parts.len() == 1 {
|
||||
return Some(PathBuf::from(parts.remove(0)));
|
||||
}
|
||||
let parts: Vec<String> = shlex::Shlex::new(pasted).collect();
|
||||
if parts.len() == 1 {
|
||||
return parts.into_iter().next().map(PathBuf::from);
|
||||
}
|
||||
|
||||
// simple quoted path fallback
|
||||
|
||||
Reference in New Issue
Block a user