about summary refs log tree commit diff stats
path: root/adapter
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-10-14 17:17:59 +0200
committerbptato <nincsnevem662@gmail.com>2024-10-14 17:17:59 +0200
commit4508e3d325bdbaabbc3f20e57a04d04419ec37f4 (patch)
tree3f3638744636cb1eb933f3ef626b2695c54152ad /adapter
parent4fb37158efa37a01a2ecc86be024c22202a879d0 (diff)
downloadchawan-4508e3d325bdbaabbc3f20e57a04d04419ec37f4.tar.gz
dirlist2html: remove redundant slash
Diffstat (limited to 'adapter')
-rw-r--r--adapter/format/dirlist2html.nim7
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