on master help sign in
Trim trailing spaces when getting a file name from the REPL
160e7e1Niklas Larsson
src/Idris/Chaser.hs+1−1
@@ -71,7 +71,7 @@ extractFileName ('"':xs) = takeWhile (/= '"') xs
71extractFileName ('\'':xs) = takeWhile (/= '\'') xs
71extractFileName ('\'':xs) = takeWhile (/= '\'') xs
72extractFileName x = build x []
72extractFileName x = build x []
73 where
73 where
74− build [] acc = reverse acc
74+ build [] acc = reverse $ dropWhile (== ' ') acc
75 build ('\\':' ':xs) acc = build xs (' ':acc)
75 build ('\\':' ':xs) acc = build xs (' ':acc)
76 build (x:xs) acc = build xs (x:acc)
76 build (x:xs) acc = build xs (x:acc)
77
77