Strip the Windows extended-length path prefix (`\\?\`) that `canonicalize()` adds. On non-Windows this is a no-op.
(path: PathBuf)
| 85 | /// Strip the Windows extended-length path prefix (`\\?\`) that `canonicalize()` adds. |
| 86 | /// On non-Windows this is a no-op. |
| 87 | fn strip_unc_prefix(path: PathBuf) -> PathBuf { |
| 88 | #[cfg(windows)] |
| 89 | { |
| 90 | let s = path.to_string_lossy(); |
| 91 | if let Some(stripped) = s.strip_prefix(r"\\?\") { |
| 92 | return PathBuf::from(stripped); |
| 93 | } |
| 94 | } |
| 95 | path |
| 96 | } |
| 97 | |
| 98 | // ============================================================================ |
| 99 | // ToolCallResult |