Commit d234820a authored by Finn Teegen's avatar Finn Teegen
Browse files

Make parsing of cpp definitions more robust

parent 46612f6b
......@@ -465,8 +465,10 @@ options =
parseCppDefinition :: String -> OptErr -> OptErr
parseCppDefinition arg optErr
| not (null $ s ++ v) && all isDigit v = onCppOpts (addCppDefinition s v) optErr
| otherwise = addErr (cppDefinitionErr arg) optErr
| not (null s) && not (null v) && all isDigit v
= onCppOpts (addCppDefinition s v) optErr
| otherwise
= addErr (cppDefinitionErr arg) optErr
where (s, v) = fmap (drop 1) $ break ('=' ==) arg
addCppDefinition :: String -> String -> CppOpts -> CppOpts
......
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