summaryrefslogtreecommitdiff
path: root/src/fmt_path.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/fmt_path.rs')
-rw-r--r--src/fmt_path.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/fmt_path.rs b/src/fmt_path.rs
index d7c5fd3..90a8d64 100644
--- a/src/fmt_path.rs
+++ b/src/fmt_path.rs
@@ -40,7 +40,8 @@ impl Default for PathFormatConfig {
/// Normalize an input path string into a canonical, platform‑agnostic form.
///
-/// This function removes ANSI escape sequences, unifies separators to `/`,
+/// This function removes ANSI escape sequences (requires `strip-ansi` feature),
+/// unifies separators to `/`,
/// collapses duplicate slashes, strips unfriendly characters (`*`, `?`, `"`, `<`, `>`, `|`),
/// resolves simple `..` components, and preserves a trailing slash when present.
///
@@ -80,7 +81,8 @@ pub fn fmt_path_str(path: impl Into<String>) -> Result<String, PathFormatError>
/// Normalize an input path string into a canonical, platform‑agnostic form.
///
-/// This function removes ANSI escape sequences, unifies separators to `/`,
+/// This function removes ANSI escape sequences (requires `strip-ansi` feature),
+/// unifies separators to `/`,
/// collapses duplicate slashes, strips unfriendly characters (`*`, `?`, `"`, `<`, `>`, `|`),
/// resolves simple `..` components, and preserves a trailing slash when present.
///
@@ -92,7 +94,7 @@ pub fn fmt_path_str_custom(
config: &PathFormatConfig,
) -> Result<String, PathFormatError> {
let path_result = path.into();
- let ends_with_slash = path_result.ends_with('/');
+ let ends_with_slash = path_result.ends_with('/') || path_result.ends_with('\\');
// ANSI Strip
#[cfg(feature = "strip-ansi")]