@@ -14,7 +14,7 @@ import Idris.CmdOptions
1414
1515import Control.Monad.State.Strict
1616import Control.Applicative
17−import System.FilePath (takeFileName)
17+import System.FilePath (takeFileName, isValid)
1818
1919import Util.System
2020
@@ -85,9 +85,11 @@ filename = (do
8585 <?> "filename"
8686 where
8787 isValidFilename :: FilePath -> Bool
88− isValidFilename path = isNonEmpty && hasNoDirectoryComponent
88+ isValidFilename path =
89+ and [isNonEmpty, isValidPath, hasNoDirectoryComponent]
8990 where
9091 isNonEmpty = path /= ""
92+ isValidPath = System.FilePath.isValid path
9193 hasNoDirectoryComponent = path == takeFileName path
9294
9395