summaryrefslogtreecommitdiff
path: root/Utility/Path.hs
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2014-01-13 18:10:21 -0400
committerJoey Hess <joey@kitenet.net>2014-01-13 18:10:21 -0400
commit14ce1badd4210ebb2660e0fb22ba4ff7f2986dee (patch)
treea0eb1548d7d879631cef51266e8f2ee65fa7a66f /Utility/Path.hs
parentdd1d8e69d4c190c7bb60d5187f7a889c6fea0d62 (diff)
downloadgit-repair-14ce1badd4210ebb2660e0fb22ba4ff7f2986dee.tar.gz
merge from git-annex
Diffstat (limited to 'Utility/Path.hs')
-rw-r--r--Utility/Path.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Utility/Path.hs b/Utility/Path.hs
index b6214b2..44ac72f 100644
--- a/Utility/Path.hs
+++ b/Utility/Path.hs
@@ -242,13 +242,13 @@ fileNameLengthLimit dir = do
- was provided by a third party and is not to be trusted, returns the closest
- sane FilePath.
-
- - All spaces and punctuation are replaced with '_', except for '.'
- - "../" will thus turn into ".._", which is safe.
+ - All spaces and punctuation and other wacky stuff are replaced
+ - with '_', except for '.' "../" will thus turn into ".._", which is safe.
-}
sanitizeFilePath :: String -> FilePath
sanitizeFilePath = map sanitize
where
sanitize c
| c == '.' = c
- | isSpace c || isPunctuation c || c == '/' = '_'
+ | isSpace c || isPunctuation c || isSymbol c || isControl c || c == '/' = '_'
| otherwise = c