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:
parent
24a62b6685
commit
ac72955d23
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue