summaryrefslogtreecommitdiff
path: root/Command/AddUrl.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/AddUrl.hs')
-rw-r--r--Command/AddUrl.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs
index c4062068a..f45d00cc6 100644
--- a/Command/AddUrl.hs
+++ b/Command/AddUrl.hs
@@ -151,6 +151,7 @@ url2file :: URI -> Maybe Int -> FilePath
url2file url pathdepth = case pathdepth of
Nothing -> filesize $ escape fullurl
Just depth
+ | depth >= length urlbits -> frombits id
| depth > 0 -> frombits $ drop depth
| depth < 0 -> frombits $ reverse . take (negate depth) . reverse
| otherwise -> error "bad --pathdepth"