fix: correct operator precedence in Windows path validation

The condition `len <= 3 && ends_with(":\\") || ends_with(":")` was
missing parentheses, causing the second ends_with check to run
regardless of path length due to && binding tighter than ||.

https://claude.ai/code/session_013ooJht2HrZUTXgNJFU79cV
This commit is contained in:
Claude 2026-04-16 07:21:16 +00:00
parent 24a62b6685
commit ac72955d23
No known key found for this signature in database

View file

@ -87,7 +87,7 @@ fn validate_workspace_path(path: &str) -> Result<(), String> {
#[cfg(windows)]
{
let upper = normalized.to_uppercase();
if upper.len() <= 3 && upper.ends_with(":\\") || upper.ends_with(":") {
if upper.len() <= 3 && (upper.ends_with(":\\") || upper.ends_with(":")) {
return Err(format!("Cannot use drive root as workspace: {}", path));
}
}