- fn = htmlquote(dirbuf.b[i].name);
- bprintf(dst, "<td class=\"filename\"><a href=\"%s\">%s</a></td>", fn, fn);
+ bprintf(dst, "<td class=\"filename\"><a href=\"%s\">", htmlquote(urlquote(dirbuf.b[i].name)));
+ bprintf(dst, "%s", htmlquote(dirbuf.b[i].name));
+ bprintf(dst, "</a></td>");