fix test suite failure on windows

This was maybe a real bug too, although I don't know what circumstances
it would be a problem. See comment for analysis of this windows drive
letter wackyness issue.

Sponsored-by: Brock Spratlen on Patreon
This commit is contained in:
Joey Hess 2021-09-01 11:32:25 -04:00
parent 6db7079cb0
commit 9595a247ae
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 37 additions and 1 deletions

View file

@ -187,7 +187,13 @@ relPathDirToFileAbs from to
dotdots = replicate (length pfrom - numcommon) ".."
numcommon = length common
#ifdef mingw32_HOST_OS
normdrive = map toLower . takeWhile (/= ':') . fromRawFilePath . takeDrive
normdrive = map toLower
-- Get just the drive letter, removing any leading
-- path separator, which takeDrive leaves on the drive
-- letter.
. dropWhileEnd (isPathSeparator . fromIntegral . ord)
. fromRawFilePath
. takeDrive
#endif
{- Checks if a command is available in PATH.