From 855adc70eb9c17f087d984c54aa1fb09747cec89 Mon Sep 17 00:00:00 2001 From: Adrian Perez Date: Thu, 30 Aug 2007 14:29:41 +0200 Subject: [PATCH] - It is ALIVE. --- ngx_http_fancyindex_module.c | 2 +- template.awk | 8 +++++++- template.h | 35 +++++++++++++++++++++++------------ template.html | 23 +++++++++++++++++------ 4 files changed, 48 insertions(+), 20 deletions(-) diff --git a/ngx_http_fancyindex_module.c b/ngx_http_fancyindex_module.c index 33ec174..513d6a1 100644 --- a/ngx_http_fancyindex_module.c +++ b/ngx_http_fancyindex_module.c @@ -529,7 +529,7 @@ skip_readme_top: * Alternative implementation: * *b->last++ = (i & 0x01) ? 'e' : 'o'; */ - b->last = nfi_cpymem_ssz(b->last, "\">last = nfi_cpymem_ssz(b->last, "\">last, entry[i].name.data, entry[i].name.len, diff --git a/template.awk b/template.awk index 74ccc51..1d66c76 100755 --- a/template.awk +++ b/template.awk @@ -25,6 +25,12 @@ BEGIN { next; } +/^$/ { + if (!varname) next; + print "\"\\n\""; + next; +} + { if (!varname) next; # Order matters @@ -39,7 +45,7 @@ END { if (varname) print ";"; print "#define NFI_TEMPLATE_SIZE (0 \\"; for (var in vars) { - print "\t+ nfi_sizeof_ssz(" var ") \\"; + print "\t+ nfi_sizeof_ssz(" vars[var] ") \\"; } print "\t)" } diff --git a/template.h b/template.h index bedd597..efd85bd 100644 --- a/template.h +++ b/template.h @@ -1,14 +1,17 @@ /* Automagically generated, do not edit! */ static const u_char t01_head1[] = "" "" +"\n" "" +"\n" "" "" -"" +"\n" "Index of " ; static const u_char t02_head2[] = "" "" +"\n" "" ; static const u_char t03_body1[] = "" "" +"\n" "

Index of " ; static const u_char t04_body2[] = "" "

" +"\n" ; static const u_char t05_list1[] = "" "" +"\n" "" "" "" "" "" +"\n" "" "" "" @@ -58,8 +68,9 @@ static const u_char t05_list1[] = "" "" "" "" +"\n" "" -"" +"" "" "" "" @@ -78,13 +89,13 @@ static const u_char t09_foot1[] = "" "" ; #define NFI_TEMPLATE_SIZE (0 \ - + nfi_sizeof_ssz(4) \ - + nfi_sizeof_ssz(5) \ - + nfi_sizeof_ssz(6) \ - + nfi_sizeof_ssz(7) \ - + nfi_sizeof_ssz(8) \ - + nfi_sizeof_ssz(0) \ - + nfi_sizeof_ssz(1) \ - + nfi_sizeof_ssz(2) \ - + nfi_sizeof_ssz(3) \ + + nfi_sizeof_ssz(t05_list1) \ + + nfi_sizeof_ssz(t06_list2) \ + + nfi_sizeof_ssz(t07_body3) \ + + nfi_sizeof_ssz(t08_body4) \ + + nfi_sizeof_ssz(t09_foot1) \ + + nfi_sizeof_ssz(t01_head1) \ + + nfi_sizeof_ssz(t02_head2) \ + + nfi_sizeof_ssz(t03_body1) \ + + nfi_sizeof_ssz(t04_body2) \ ) diff --git a/template.html b/template.html index 7ac7dfb..86b3dbc 100644 --- a/template.html +++ b/template.html @@ -1,13 +1,16 @@ + + - + Index of <!-- var NONE --> /path/to/somewhere <!-- var t02_head2 --> + +

Index of /path/to/somewhere

+
File NameDate
Parent directory/--
+ + @@ -57,24 +67,25 @@ + - + - + - + - +
File NameDate
Parent directory/ - -
test file 1 123kB date
test file 2 321MB date
test file 3 666 date