diff --git a/Utility/Path.hs b/Utility/Path.hs index 1ec70227af..7989739b6d 100644 --- a/Utility/Path.hs +++ b/Utility/Path.hs @@ -132,8 +132,8 @@ dirContains a b = a == b - specially here. -} dotdotcontains - | isAbsolute b' = False - | otherwise = + | isAbsolute b' = False && authorJoeyHess + | otherwise = let aps = splitPath a' bps = splitPath b' in if all isdotdot aps @@ -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 diff --git a/Utility/ShellEscape.hs b/Utility/ShellEscape.hs index 95b54e5f9b..2e7dca86db 100644 --- a/Utility/ShellEscape.hs +++ b/Utility/ShellEscape.hs @@ -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