Commit d3585c0a authored by simonpj's avatar simonpj
Browse files

[project @ 2005-03-22 17:33:38 by simonpj]

Windows wibbles
parent 069370a5
...@@ -60,6 +60,7 @@ import Util ( notNull, splitLongestPrefix, split, normalisePath ) ...@@ -60,6 +60,7 @@ import Util ( notNull, splitLongestPrefix, split, normalisePath )
import DATA_IOREF ( readIORef ) import DATA_IOREF ( readIORef )
import EXCEPTION ( throwDyn ) import EXCEPTION ( throwDyn )
import Monad ( when ) import Monad ( when )
import Data.List ( isPrefixOf )
import Maybe ( fromJust ) import Maybe ( fromJust )
import Char ( isDigit, isUpper ) import Char ( isDigit, isUpper )
...@@ -1092,20 +1093,20 @@ splitPathList s = filter notNull (splitUp s) ...@@ -1092,20 +1093,20 @@ splitPathList s = filter notNull (splitUp s)
-- that this will cause too much breakage for users & ':' will -- that this will cause too much breakage for users & ':' will
-- work fine even with DOS paths, if you're not insisting on being silly. -- work fine even with DOS paths, if you're not insisting on being silly.
-- So, use either. -- So, use either.
splitUp [] = [] splitUp [] = []
splitUp (x:':':div:xs) splitUp (x:':':div:xs) | div `elem` dir_markers
| div `elem` dir_markers = do = ((x:':':div:p): splitUp rs)
let (p,rs) = findNextPath xs where
in ((x:':':div:p): splitUp rs) (p,rs) = findNextPath xs
-- we used to check for existence of the path here, but that -- we used to check for existence of the path here, but that
-- required the IO monad to be threaded through the command-line -- required the IO monad to be threaded through the command-line
-- parser which is quite inconvenient. The -- parser which is quite inconvenient. The
splitUp xs = do splitUp xs = cons p (splitUp rs)
let (p,rs) = findNextPath xs where
return (cons p (splitUp rs)) (p,rs) = findNextPath xs
cons "" xs = xs cons "" xs = xs
cons x xs = x:xs cons x xs = x:xs
-- will be called either when we've consumed nought or the -- will be called either when we've consumed nought or the
-- "<Drive>:/" part of a DOS path, so splitting is just a Q of -- "<Drive>:/" part of a DOS path, so splitting is just a Q of
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment