X-Git-Url: http://www.dolda2000.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhtls.c;h=060d1bf5a3b65a5086b34df0e10a0c33a46c7512;hb=3095582d21be4087f774f5a68a2a9abfa37dd1ff;hp=e16004d2a063c7f1fc9073a182571176b36e9c72;hpb=121d8be9d4bdeea6a083d9bf791677e9150e6324;p=ashd.git diff --git a/src/htls.c b/src/htls.c index e16004d..060d1bf 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) { @@ -72,14 +73,27 @@ static int dcmp(const void *ap, const void *bp) static void head(char *name, struct charbuf *dst) { - char *title; + char *title, *tmp; + 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); + 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, "