Skip to content

Commit 2341b49

Browse files
committed
fix: always output forward slashes on all platforms for glob v13 compatibility
1 parent 5419121 commit 2341b49

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/glob.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1960,14 +1960,15 @@ impl Glob {
19601960

19611961
/// Check if backslashes should be normalized to forward slashes.
19621962
///
1963-
/// On Windows, when `posix: false` (the default), paths should use native backslashes
1964-
/// to match glob's behavior. On all other platforms, or when `posix: true`, we normalize
1965-
/// to forward slashes.
1963+
/// This function always returns true because glob v13 outputs forward slashes
1964+
/// on all platforms for cross-platform consistency. The `posix` option affects
1965+
/// pattern matching semantics (e.g., whether backslashes are escape characters),
1966+
/// not the output format.
19661967
#[inline]
19671968
fn should_normalize_backslashes(&self) -> bool {
1968-
// On Windows with posix: false, keep backslashes
1969-
// Otherwise, normalize to forward slashes
1970-
self.posix || !cfg!(target_os = "windows")
1969+
// Always use forward slashes for output - this matches glob v13 behavior
1970+
// which outputs forward slashes on all platforms for consistency
1971+
true
19711972
}
19721973

19731974
/// Normalize path separators based on platform and posix option.

0 commit comments

Comments
 (0)