title = sstrdup(htmlquote(name));
bprintf(dst, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
title = sstrdup(htmlquote(name));
bprintf(dst, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
bprintf(dst, "<head>\n");
bprintf(dst, "<title>Index of %s</title>\n", title);
if(stylesheet) {
bprintf(dst, "<head>\n");
bprintf(dst, "<title>Index of %s</title>\n", title);
if(stylesheet) {
bprintf(dst, "body {font-family: sans-serif; background: #eee;}\n");
bprintf(dst, ".dirindex {background: white; padding: 1em; border: thin solid #ccc;}\n");
bprintf(dst, ".dirindex table {border-collapse: collapse;}\n");
bprintf(dst, ".dirindex td {padding: 0 1em;}\n");
bprintf(dst, ".dentry:hover {background: #ddd;}\n");
bprintf(dst, ".dir {background: #ddf;}\n");
bprintf(dst, "body {font-family: sans-serif; background: #eee;}\n");
bprintf(dst, ".dirindex {background: white; padding: 1em; border: thin solid #ccc;}\n");
bprintf(dst, ".dirindex table {border-collapse: collapse;}\n");
bprintf(dst, ".dirindex td {padding: 0 1em;}\n");
bprintf(dst, ".dentry:hover {background: #ddd;}\n");
bprintf(dst, ".dir {background: #ddf;}\n");
bprintf(dst, ".exec {background: #dfd;}\n");
bprintf(dst, "</style>\n");
}
bprintf(dst, ".exec {background: #dfd;}\n");
bprintf(dst, "</style>\n");
}
- 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>");
if(dispsize) {
bprintf(dst, "<td class=\"filesize\">");
if(!S_ISDIR(dirbuf.b[i].sb.st_mode))
if(dispsize) {
bprintf(dst, "<td class=\"filesize\">");
if(!S_ISDIR(dirbuf.b[i].sb.st_mode))