Improve SHA*E extension extraction code.
Filter out over-long "extensions" before stripping out non-alphanumerics from them, so that eg "foo.ba__________r" is not considered a .bar extension.
This commit is contained in:
parent
d2fa4a6873
commit
45308ec78b
3 changed files with 11 additions and 2 deletions
|
@ -101,8 +101,9 @@ selectExtension f
|
|||
| otherwise = intercalate "." ("":es)
|
||||
where
|
||||
es = filter (not . null) $ reverse $
|
||||
take 2 $ takeWhile shortenough $
|
||||
reverse $ split "." $ filter validInExtension $ takeExtensions f
|
||||
take 2 $ map (filter validInExtension) $
|
||||
takeWhile shortenough $
|
||||
reverse $ split "." $ takeExtensions f
|
||||
shortenough e = length e <= 4 -- long enough for "jpeg"
|
||||
|
||||
{- A key's checksum is checked during fsck. -}
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
git-annex (6.20160528) UNRELEASED; urgency=medium
|
||||
|
||||
* Improve SHA*E extension extraction code.
|
||||
|
||||
-- Joey Hess <id@joeyh.name> Fri, 27 May 2016 13:12:48 -0400
|
||||
|
||||
git-annex (6.20160527) unstable; urgency=medium
|
||||
|
||||
* Split lines in the git-annex branch on \r as well as \n, to deal
|
||||
|
|
|
@ -13,3 +13,5 @@ lrwxrwxrwx 1 yoh yoh 126 May 25 14:27 ds001_R1.1.0_raw.tgz -> .git/annex/objects
|
|||
"""]]
|
||||
|
||||
[[!meta author=yoh]]
|
||||
|
||||
> [[fixed|done]] --[[Joey]]
|
||||
|
|
Loading…
Reference in a new issue