summaryrefslogtreecommitdiff
path: root/Backend.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Backend.hs')
-rw-r--r--Backend.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Backend.hs b/Backend.hs
index f7990c22c..136c2eb7a 100644
--- a/Backend.hs
+++ b/Backend.hs
@@ -64,7 +64,13 @@ genKey' (b:bs) file = do
r <- (B.getKey b) file
case r of
Nothing -> genKey' bs file
- Just k -> return $ Just (k, b)
+ Just k -> return $ Just (makesane k, b)
+ where
+ -- keyNames should not contain newline characters.
+ makesane k = k { keyName = map fixbadchar (keyName k) }
+ fixbadchar c
+ | c == '\n' = '_'
+ | otherwise = c
{- Looks up the key and backend corresponding to an annexed file,
- by examining what the file symlinks to. -}