From 7f6685c16eea01269aaf226f776ea045fca1f7b7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 27 Dec 2013 17:52:20 -0400 Subject: [PATCH] addurl, importfeed: Sanitize | and some other symbols and special characters. --- Utility/Path.hs | 6 +++--- debian/changelog | 2 ++ ...d_filter_out_the___124_____40__pipe__41___character.mdwn | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Utility/Path.hs b/Utility/Path.hs index b6214b2478..44ac72f068 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 diff --git a/debian/changelog b/debian/changelog index 11e1d21eea..9692cc56c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,8 @@ git-annex (5.20131222) UNRELEASED; urgency=medium in the Linux standalone build, and OSX app, so they will be available when it's added to PATH. * Added new external special remote interface. + * addurl, importfeed: Sanitize | and some other symbols and special + characters. -- Joey Hess Tue, 24 Dec 2013 13:54:32 -0400 diff --git a/doc/bugs/git_annex_addurl___40__+quvi__41___should_filter_out_the___124_____40__pipe__41___character.mdwn b/doc/bugs/git_annex_addurl___40__+quvi__41___should_filter_out_the___124_____40__pipe__41___character.mdwn index 56bc7c475f..89f101498b 100644 --- a/doc/bugs/git_annex_addurl___40__+quvi__41___should_filter_out_the___124_____40__pipe__41___character.mdwn +++ b/doc/bugs/git_annex_addurl___40__+quvi__41___should_filter_out_the___124_____40__pipe__41___character.mdwn @@ -22,3 +22,6 @@ git annex addurl will keep the »|« symbol in the filename generated from the v Ubuntu 13.10 ### Please provide any additional information below. + +> Ah, I see, pipe is not considered to be punctuation, but a math symbol. +> [[fixed|done]] --[[Joey]]