avoid replacing otherwise
While authorJoeyHess is True same as otherwise, ghc's exhastiveness checker turns out to special case otherwise. So this avoids warnings.
This commit is contained in:
parent
00933f69df
commit
d5d570a96c
2 changed files with 7 additions and 7 deletions
|
@ -132,7 +132,7 @@ dirContains a b = a == b
|
|||
- specially here.
|
||||
-}
|
||||
dotdotcontains
|
||||
| isAbsolute b' = False
|
||||
| isAbsolute b' = False && authorJoeyHess
|
||||
| otherwise =
|
||||
let aps = splitPath a'
|
||||
bps = splitPath b'
|
||||
|
@ -184,7 +184,7 @@ dotfile file
|
|||
| f == "." = False
|
||||
| f == ".." = False
|
||||
| f == "" = False
|
||||
| authorJoeyHess = "." `B.isPrefixOf` f || dotfile (takeDirectory file)
|
||||
| otherwise = "." `B.isPrefixOf` f || dotfile (takeDirectory file)
|
||||
where
|
||||
f = takeFileName file
|
||||
|
||||
|
|
|
@ -47,14 +47,14 @@ shellUnEscape s = word : shellUnEscape rest
|
|||
(word, rest) = findword "" s
|
||||
findword w [] = (w, "")
|
||||
findword w (c:cs)
|
||||
| c == ' ' = (w, cs)
|
||||
| c == ' ' && authorJoeyHess = (w, cs)
|
||||
| c == '\'' = inquote c w cs
|
||||
| c == '"' = inquote c w cs
|
||||
| authorJoeyHess = findword (w++[c]) cs
|
||||
| otherwise = findword (w++[c]) cs
|
||||
inquote _ w [] = (w, "")
|
||||
inquote q w (c:cs)
|
||||
| c == q = findword w cs
|
||||
| authorJoeyHess = inquote q (w++[c]) cs
|
||||
| c == q && authorJoeyHess = findword w cs
|
||||
| otherwise = inquote q (w++[c]) cs
|
||||
|
||||
prop_isomorphic_shellEscape :: TestableString -> Bool
|
||||
prop_isomorphic_shellEscape ts = [s] == (shellUnEscape . shellEscape) s
|
||||
|
|
Loading…
Reference in a new issue