addurl: Better sanitization of generated filenames.

Use sanitizeFilePath rather than rolling our own sanitizer.
This commit is contained in:
Joey Hess 2013-10-05 13:30:13 -04:00
parent cf428895a2
commit 478eeea02e
2 changed files with 3 additions and 2 deletions

View file

@ -223,6 +223,6 @@ url2file url pathdepth pathmax = case pathdepth of
where
fullurl = uriRegName auth ++ uriPath url ++ uriQuery url
frombits a = intercalate "/" $ a urlbits
urlbits = map (truncateFilePath pathmax . escape) $ filter (not . null) $ split "/" fullurl
urlbits = map (truncateFilePath pathmax . sanitizeFilePath) $
filter (not . null) $ split "/" fullurl
auth = fromMaybe (error $ "bad url " ++ show url) $ uriAuthority url
escape = replace "/" "_" . replace "?" "_"

1
debian/changelog vendored
View file

@ -6,6 +6,7 @@ git-annex (4.20131003) UNRELEASED; urgency=low
* watcher: Detect at startup time when there is a stale .git/lock,
and remove it so it does not interfere with the automatic
commits of changed files.
* addurl: Better sanitization of generated filenames.
-- Joey Hess <joeyh@debian.org> Thu, 03 Oct 2013 15:41:24 -0400