diff options
author | Joey Hess <joey@kitenet.net> | 2013-12-06 18:26:52 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-12-06 18:26:52 -0400 |
commit | 3161983a472c851994ad083ef13ebf7e04e71cbd (patch) | |
tree | 75a2363ee5557bd4040d53c0b413cb64c743ab68 /Build/EvilLinker.hs | |
parent | 9bc75d16fb06548f5113a51796b22ab1e42f7c2d (diff) |
improve parser robustness
Diffstat (limited to 'Build/EvilLinker.hs')
-rw-r--r-- | Build/EvilLinker.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Build/EvilLinker.hs b/Build/EvilLinker.hs index b6377064d..daa09d148 100644 --- a/Build/EvilLinker.hs +++ b/Build/EvilLinker.hs @@ -81,17 +81,16 @@ parseGccLink = do {- Find where collect2 calls ld. -} parseCollect2 :: Parser CmdParams parseCollect2 = do - try $ do - string "GNU ld" - restOfLine - string "collect2 version" - restOfLine + manyTill restOfLine (try versionline) path <- manyTill anyChar (try $ string ldcmd) char ' ' params <- restOfLine return $ CmdParams (path ++ ldcmd) (escapeDosPaths params) Nothing where ldcmd = "ld.exe" + versionline = do + string "collect2 version" + restOfLine {- Input contains something like - c:/program files/haskell platform/foo -LC:/Program Files/Haskell Platform/ -L... |