diff --git a/CHANGELOG b/CHANGELOG index 2b2823d998..2ce4f60831 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,8 @@ git-annex (10.20250606) UNRELEASED; urgency=medium * Skip and warn when a tree import includes empty filenames, which can happen with eg a S3 bucket. + * Avoid a problem with temp file names ending in whitespace on + filesystems like VFAT that don't support such filenames. -- Joey Hess Mon, 23 Jun 2025 11:11:29 -0400 diff --git a/Utility/Tmp.hs b/Utility/Tmp.hs index f8be5b29c0..f373ca6c1c 100644 --- a/Utility/Tmp.hs +++ b/Utility/Tmp.hs @@ -117,13 +117,15 @@ relatedTemplate' :: RawFilePath -> RawFilePath relatedTemplate' f | len > templateAddedLength = {- Some filesystems like FAT have issues with filenames - - ending in ".", so avoid truncating a filename to end - - that way. -} - B.dropWhileEnd (== dot) $ + - ending in ".", and others like VFAT don't allow a + - filename to end with trailing whitespace, so avoid + - truncating a filename to end that way. -} + B.dropWhileEnd disallowed $ truncateFilePath (len - templateAddedLength) f | otherwise = f where len = B.length f + disallowed c = c == dot || isSpace (chr (fromIntegral c)) dot = fromIntegral (ord '.') #else -- Avoids a test suite failure on windows, reason unknown, but diff --git a/doc/bugs/openTempfile_invalid_argument_on_sd_card.mdwn b/doc/bugs/openTempfile_invalid_argument_on_sd_card.mdwn index f3c37c5327..2763ae3a17 100644 --- a/doc/bugs/openTempfile_invalid_argument_on_sd_card.mdwn +++ b/doc/bugs/openTempfile_invalid_argument_on_sd_card.mdwn @@ -43,3 +43,5 @@ failed ### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders) I use it quite successfully to archive media on removable spinning hard drives. + +> [[fixed|done]] --[[Joey]]