X-Git-Url: http://git.dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fhtls.c;h=f51da938daf87cc87b598382e45cc26aae495e01;hb=refs%2Fheads%2Fsolib;hp=e16004d2a063c7f1fc9073a182571176b36e9c72;hpb=121d8be9d4bdeea6a083d9bf791677e9150e6324;p=ashd.git diff --git a/src/htls.c b/src/htls.c index e16004d..f51da93 100644 --- a/src/htls.c +++ b/src/htls.c @@ -43,6 +43,7 @@ struct dentry { static int dispmtime = 0; static int dispsize = 0; +static char *stylesheet = NULL; static void checkcache(struct stat *sb) { @@ -74,12 +75,26 @@ static void head(char *name, struct charbuf *dst) { char *title; + title = sstrdup(htmlquote(name)); bprintf(dst, "\n"); bprintf(dst, "\n"); bprintf(dst, "\n"); bprintf(dst, "
\n"); - title = htmlquote(name); bprintf(dst, "%s | ", fn, fn); - free(fn); - if(dispsize && !S_ISDIR(dirbuf.b[i].sb.st_mode)) - bprintf(dst, "%ji | ", (intmax_t)dirbuf.b[i].sb.st_size); + bprintf(dst, "", htmlquote(urlquote(dirbuf.b[i].name))); + bprintf(dst, "%s", htmlquote(dirbuf.b[i].name)); + bprintf(dst, " | "); + if(dispsize) { + bprintf(dst, ""); + if(!S_ISDIR(dirbuf.b[i].sb.st_mode)) + bprintf(dst, "%ji", (intmax_t)dirbuf.b[i].sb.st_size); + bprintf(dst, " | "); + } if(dispmtime) bprintf(dst, "%s | ", fmthttpdate(dirbuf.b[i].sb.st_mtime)); bprintf(dst, "