From 73ec3ba0307841f75677f9f0d997627f6fc55fd5 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Tue, 17 Dec 2024 11:40:49 -0500 Subject: [PATCH] Use pathSeparator instead of literal char --- .../src/Distribution/Solver/Types/ProjectConfigPath.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cabal-install-solver/src/Distribution/Solver/Types/ProjectConfigPath.hs b/cabal-install-solver/src/Distribution/Solver/Types/ProjectConfigPath.hs index 3ba3603d8dc..94eeff6d23d 100644 --- a/cabal-install-solver/src/Distribution/Solver/Types/ProjectConfigPath.hs +++ b/cabal-install-solver/src/Distribution/Solver/Types/ProjectConfigPath.hs @@ -95,8 +95,12 @@ instance Ord ProjectConfigPath where splitPath = FP.splitPath . normSep where normSep p = if buildOS == Windows - then Windows.joinPath $ Windows.splitDirectories [if c == '/' then '\\' else c| c <- p] - else Posix.joinPath $ Posix.splitDirectories [if c == '\\' then '/' else c| c <- p] + then + Windows.joinPath $ Windows.splitDirectories + [if c == Posix.pathSeparator then Windows.pathSeparator else c| c <- p] + else + Posix.joinPath $ Posix.splitDirectories + [if c == Windows.pathSeparator then Posix.pathSeparator else c| c <- p] aPaths = splitPath <$> as bPaths = splitPath <$> bs