remove SafeFilePath
Move sanitizeFilePath call to where fromSafeFilePath had been.
This commit is contained in:
parent
cabbc91b18
commit
5f5170b22b
6 changed files with 16 additions and 32 deletions
|
@ -25,9 +25,14 @@ import System.FilePath
|
|||
- so no dotfiles that might control a program are inadvertently created,
|
||||
- and to avoid filenames being treated as options to commands the user
|
||||
- might run.
|
||||
-
|
||||
- Also there's an off chance the string might be empty, so to avoid
|
||||
- needing to handle such an invalid filepath, return a dummy "file" in
|
||||
- that case.
|
||||
-}
|
||||
sanitizeFilePath :: String -> FilePath
|
||||
sanitizeFilePath = leading . map sanitize
|
||||
sanitizeFilePath [] = "file"
|
||||
sanitizeFilePath f = leading (map sanitize f)
|
||||
where
|
||||
sanitize c
|
||||
| c == '.' || c == '-' = c
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue