You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
strip_trailing_separator incorrectly handles UNC and network paths on Windows #294
The strip_trailing_separator function in crates/pet-fs/src/path.rs has a logic error on Windows. The current implementation uses result.len() > 3 to preserve root paths like C:\, but this fails for:
UNC paths like \\server\share\ (length > 3) which would incorrectly have the trailing separator stripped
Network paths like \\server\ which should be preserved as root paths
Extended-length paths like \\?\C:\ which should also be preserved
Current Code (Line 35)
while result.len() > 3 && (result.ends_with('\\') || result.ends_with('/')){
result.pop();}
Proposed Fix
Use Path::parent().is_some() for robust root detection, similar to how normalize_case_windows() already handles this correctly:
Activity
Enhance strip_trailing_separator to handle UNC and extended-length pa…