From d727566e8645574c0fc6c2b0830a922d0d8f13d0 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sat, 26 Dec 2015 03:07:36 +0100 Subject: [PATCH] LIB: don't allow empty FileName argument in createFile/renameFile --- src/IO/File.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/IO/File.hs b/src/IO/File.hs index 79df8e5..6b53fc1 100644 --- a/src/IO/File.hs +++ b/src/IO/File.hs @@ -398,6 +398,7 @@ executeFile _ _ = return Nothing createFile :: AnchoredFile FileInfo -> FileName -> IO () +createFile _ "" = return () createFile _ "." = return () createFile _ ".." = return () createFile (SADir td) fn = do @@ -423,6 +424,7 @@ createFile (SADir td) fn = do renameFile :: AnchoredFile FileInfo -> FileName -> IO () renameFile (_ :/ Failed {}) _ = return () +renameFile _ "" = return () renameFile _ "." = return () renameFile _ ".." = return () renameFile af fn = do