addurl --pathdepth: Fix failure when the pathdepth specified is deeper than the urls's path.
This commit is contained in:
parent
d84a000e92
commit
74ad3072e4
3 changed files with 9 additions and 0 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue