From: Micah Cowan Date: Thu, 13 Nov 2008 05:00:05 +0000 (-0800) Subject: HTML-escape dir name in title, h1. X-Git-Tag: v1.13~380 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=ca12585a0e221e31a59898fe33f1a0caf7918f26 HTML-escape dir name in title, h1. --- diff --git a/src/ChangeLog b/src/ChangeLog index da701d6c..1d09c933 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2008-11-12 Micah Cowan + + * ftp-ls.c (ftp_index): HTML-escape dir name in title, h1. + 2008-11-12 Alexander Belopolsky * url.c, url.h (url_escape_unsafe_and_reserved): Added. diff --git a/src/ftp-ls.c b/src/ftp-ls.c index dd6caa66..d996b8ad 100644 --- a/src/ftp-ls.c +++ b/src/ftp-ls.c @@ -850,6 +850,7 @@ ftp_index (const char *file, struct url *u, struct fileinfo *f) { FILE *fp; char *upwd; + char *htcldir; /* HTML-clean dir name */ char *htclfile; /* HTML-clean file name */ char *urlclfile; /* URL-clean file name */ @@ -879,12 +880,17 @@ ftp_index (const char *file, struct url *u, struct fileinfo *f) } else upwd = xstrdup (""); + + htcldir = html_quote_string (u->dir); + fprintf (fp, "\n"); fprintf (fp, "\n\n"); - fprintf (fp, _("Index of /%s on %s:%d"), u->dir, u->host, u->port); + fprintf (fp, _("Index of /%s on %s:%d"), htcldir, u->host, u->port); fprintf (fp, "\n\n\n

"); - fprintf (fp, _("Index of /%s on %s:%d"), u->dir, u->host, u->port); + fprintf (fp, _("Index of /%s on %s:%d"), htcldir, u->host, u->port); fprintf (fp, "

\n
\n
\n");
+
+  xfree (htcldir);
   while (f)
     {
       fprintf (fp, "  ");