fix temp filename

Was not putting it inside the temp dir, but next to it!

This was just wrong, and it led to a longer filename that desired being
used, leading to some bug reports.
This commit is contained in:
Joey Hess 2015-12-06 16:50:37 -04:00
parent 6e71094e7d
commit 2936153fc4
Failed to extract signature
6 changed files with 43 additions and 1 deletions

View file

@ -30,7 +30,7 @@ replaceFile file action = do
filemax <- liftIO $ fileNameLengthLimit misctmpdir
let basetmp = take (filemax `div` 2) (takeFileName file)
withTmpDirIn misctmpdir basetmp $ \tmpdir -> do
let tmpfile = tmpdir <> basetmp
let tmpfile = tmpdir </> basetmp
action tmpfile
liftIO $ replaceFileFrom tmpfile file