Commit 5943a5b2 authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

Use Test.Regex.PCRE instead of .Posix in compare

This program:

    main :: IO ()
    main = do re "[^ ]" "\207"
              re "[ ]" "\207"
              re " " "\207"

    re :: String -> String -> IO ()
    re r str = let r' = makeRegex r :: Regex
                   res = matchM r' str :: Maybe (String, String, String, [String])
               in print res

prints

    Nothing
    Nothing
    Nothing

for me with Posix, but

    Just ("","\207","",[])
    Nothing
    Nothing

with PCRE. This was causing compare to fail with

    Tar line doesn't parse: "drwxrwxr-x simonmar/GHC       0 2012-12-08 21:35 ghc-7.6.1.20121207/libraries/haskeline/tests/dummy-\206\188\206\177\207\\302\\203/"

on the GHC source tarball.
parent a3a2348c
......@@ -5,7 +5,7 @@ import Data.Function
import Data.List
import System.Exit
import System.IO
import Text.Regex.Posix
import Text.Regex.PCRE
die :: Errors -> IO a
die errs = do mapM_ (hPutStrLn stderr) errs
......
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