diff options
Diffstat (limited to 'Remote/External.hs')
-rw-r--r-- | Remote/External.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Remote/External.hs b/Remote/External.hs index 7e2b2d0b0..47220c23c 100644 --- a/Remote/External.hs +++ b/Remote/External.hs @@ -434,12 +434,14 @@ checkurl :: External -> URLString -> Annex UrlContents checkurl external url = handleRequest external (CHECKURL url) Nothing $ \req -> case req of CHECKURL_CONTENTS sz f -> Just $ return $ UrlContents sz - (if null f then Nothing else Just f) + (if null f then Nothing else Just $ mkSafeFilePath f) -- Treat a single item multi response specially to -- simplify the external remote implementation. CHECKURL_MULTI ((_, sz, f):[]) -> - Just $ return $ UrlContents sz (Just f) - CHECKURL_MULTI l -> Just $ return $ UrlMulti l + Just $ return $ UrlContents sz $ Just $ mkSafeFilePath f + CHECKURL_MULTI l -> Just $ return $ UrlMulti $ map mkmulti l CHECKURL_FAILURE errmsg -> Just $ error errmsg UNSUPPORTED_REQUEST -> error "CHECKURL not implemented by external special remote" _ -> Nothing + where + mkmulti (u, s, f) = (u, s, mkSafeFilePath f) |