# HG changeset patch # User corvid # Date 1275849516 0 # Node ID 2b3cba462b2372227ccd56e9b45833c14f4a6bd9 # Parent 2adf63a0999bef6f2478b0c06fa14cf4644532b7 vsource page add title element diff -r 2adf63a0999b -r 2b3cba462b23 dpi/vsource.c --- a/dpi/vsource.c Sun Jun 06 18:05:33 2010 +0000 +++ b/dpi/vsource.c Sun Jun 06 18:38:36 2010 +0000 @@ -96,11 +96,14 @@ /* * Send source as html text with line numbers */ -void send_html_text(Dsh *sh, int data_size) +void send_html_text(Dsh *sh, const char *url, int data_size) { int bytes_read = 0, old_line = 0, line = 1; char *p, *q, *src_str, line_str[128]; + if (strncmp(url, "dpi:/vsource/:", 14) == 0) + url += 14; + /* Send HTTP header for plain text MIME type */ a_Dpip_dsh_printf(sh, 0, "Content-type: text/html\n\n"); @@ -108,10 +111,11 @@ a_Dpip_dsh_printf(sh, 0, "\n" "\n" + "Source for %s\n" "\n" "\n" - "\n\n"); + "\n
\n", url); while (bytes_read < data_size && (src_str = a_Dpip_dsh_read_token(sh, 1))) { @@ -211,7 +215,7 @@ /* Choose your flavour */ //send_plain_text(sh, data_size); //send_numbered_text(sh, data_size); - send_html_text(sh, data_size); + send_html_text(sh, url, data_size); } else if (strcmp(cmd2, "DpiError") == 0) { /* Dillo detected an error (other failures just close the socket) */ a_Dpip_dsh_printf(sh, 0, "Content-type: text/plain\n\n");