on master help sign in
Remove whitespace for :addproof - like :load does

This should probably happen for all commands which take a filename.

commitd773ae81e864fce7b78f1cebc72a071054da1eab authorBrian McKenna <brian@brianmckenna.org> dateSat 26 Apr 2014, 21:43 (13 years ago) parent62705e4
1 file changed+5−4
src/Idris/REPL.hs+5−4
src/Idris/REPL.hs+5−4
@@ -900,14 +900,15 @@ process h fn (RmProof n')
900900
901901process h fn' (AddProof prf)
902902 = do fn <- do
903− ex <- runIO $ doesFileExist fn'
904− let fnExt = fn' <.> "idr"
903+ let fn'' = takeWhile (/= ' ') fn'
904+ ex <- runIO $ doesFileExist fn''
905+ let fnExt = fn'' <.> "idr"
905906 exExt <- runIO $ doesFileExist fnExt
906907 if ex
907− then return fn'
908+ then return fn''
908909 else if exExt
909910 then return fnExt
910− else ifail $ "Neither \""++fn'++"\" nor \""++fnExt++"\" exist"
911+ else ifail $ "Neither \""++fn''++"\" nor \""++fnExt++"\" exist"
911912 let fb = fn ++ "~"
912913 runIO $ copyFile fn fb -- make a backup in case something goes wrong!
913914 prog <- runIO $ readFile fb