MCPcopy Create free account
hub / github.com/AI45Lab/Code / strip_unc_prefix

Function strip_unc_prefix

core/src/agent_api.rs:87–96  ·  view source on GitHub ↗

Strip the Windows extended-length path prefix (`\\?\`) that `canonicalize()` adds. On non-Windows this is a no-op.

(path: PathBuf)

Source from the content-addressed store, hash-verified

85/// Strip the Windows extended-length path prefix (`\\?\`) that `canonicalize()` adds.
86/// On non-Windows this is a no-op.
87fn 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

Callers 1

safe_canonicalizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected