OsPath transition Windows build fixes

This gets it building on Windows again, with 1 test suite failure
(addurl).

Sponsored-by: Kevin Mueller
This commit is contained in:
Joey Hess 2025-02-11 19:23:02 -08:00 committed by Joey Hess
parent 9dc43396b3
commit a149336a59
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
23 changed files with 58 additions and 62 deletions

View file

@ -43,7 +43,6 @@ import qualified Utility.OsString as OS
#ifdef mingw32_HOST_OS
import Data.Char
import Utility.FileSystemEncoding
#endif
copyright :: Authored t => t
@ -230,11 +229,11 @@ relPathDirToFileAbs from to
numcommon = length common
#ifdef mingw32_HOST_OS
normdrive = map toLower
. fromOsPath
-- Get just the drive letter, removing any leading
-- path separator, which takeDrive leaves on the drive
-- letter.
. dropWhileEnd (isPathSeparator . fromIntegral . ord)
. fromOsPath
. OS.dropWhileEnd isPathSeparator
. takeDrive
#endif
@ -261,7 +260,7 @@ searchPath command
indir d = check (d </> command')
check f = firstM doesFileExist
#ifdef mingw32_HOST_OS
[f, f <> ".exe"]
[f, f <> literalOsPath ".exe"]
#else
[f]
#endif