diff options
author | bptato <nincsnevem662@gmail.com> | 2024-10-14 17:17:59 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-10-14 17:17:59 +0200 |
commit | 4508e3d325bdbaabbc3f20e57a04d04419ec37f4 (patch) | |
tree | 3f3638744636cb1eb933f3ef626b2695c54152ad /adapter/format | |
parent | 4fb37158efa37a01a2ecc86be024c22202a879d0 (diff) | |
download | chawan-4508e3d325bdbaabbc3f20e57a04d04419ec37f4.tar.gz |
dirlist2html: remove redundant slash
Diffstat (limited to 'adapter/format')
-rw-r--r-- | adapter/format/dirlist2html.nim | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/adapter/format/dirlist2html.nim b/adapter/format/dirlist2html.nim index 08981f20..d658e2ac 100644 --- a/adapter/format/dirlist2html.nim +++ b/adapter/format/dirlist2html.nim @@ -26,11 +26,8 @@ proc printDirlist(f: File; items: seq[DirlistItem]; maxw: int) = f.writeLine("<a href=\"../\">[Upper Directory]</a>") for item in items: var path = percentEncode(item.name, PathPercentEncodeSet) - if item.t == ditLink: - if item.linkto.len > 0 and item.linkto[^1] == '/': - # If the target is a directory, treat it as a directory. (For FTP.) - path &= '/' - elif item.t == ditDir: + if item.t == ditLink and item.linkto.len > 0 and item.linkto[^1] == '/': + # If the target is a directory, treat it as a directory. (For FTP.) path &= '/' var line = "<a href=\"" & path & "\">" & htmlEscape(item.dname) & "</a>" var width = item.width |