From ac72955d2396c5f0141c1e5b53610b7d9930e2c6 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 16 Apr 2026 07:21:16 +0000 Subject: [PATCH] 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 --- apps/tauri/src-tauri/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/tauri/src-tauri/src/lib.rs b/apps/tauri/src-tauri/src/lib.rs index 7bdb221..6db3de8 100644 --- a/apps/tauri/src-tauri/src/lib.rs +++ b/apps/tauri/src-tauri/src/lib.rs @@ -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)); } }