changeset 1677:2adf63a0999b

vsource fix extraneous </pre> with empty source file
author corvid <corvid@lavabit.com>
date Sun, 06 Jun 2010 18:05:33 +0000
parents 380c28dea5a9
children 2b3cba462b23
files dpi/vsource.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dpi/vsource.c	Fri May 28 16:10:43 2010 +0000
+++ b/dpi/vsource.c	Sun Jun 06 18:05:33 2010 +0000
@@ -110,7 +110,8 @@
                      "<html><head>\n"
                      "<style type=\"text/css\">PRE {white-space: pre-wrap}\n"
                      "</style>\n"
-                     "</head><body id=\"dillo_vs\">\n<table cellpadding='0'>\n");
+                     "</head>\n"
+                     "<body id=\"dillo_vs\">\n<table cellpadding='0'>\n");
 
    while (bytes_read < data_size &&
           (src_str = a_Dpip_dsh_read_token(sh, 1))) {
@@ -146,7 +147,9 @@
       dFree(src_str);
    }
 
-   a_Dpip_dsh_printf(sh, 1, "</pre></table></body></html>");
+   if (data_size > 0)
+      a_Dpip_dsh_printf(sh, 0, "</pre>");
+   a_Dpip_dsh_printf(sh, 1, "</table></body></html>");
 }
 
 /*