X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fftp-ls.c;fp=src%2Fftp-ls.c;h=dd6caa661273b1fb422d0fd6157d9a06ea5feab7;hp=660302e5b33a51ad8178a3bf30181b4cef47c5d4;hb=cf93ce7f4b428c78ca705f0f905ba75bbb2806d5;hpb=1777835073cad695bce04848aa6f33e9686e7fc1 diff --git a/src/ftp-ls.c b/src/ftp-ls.c index 660302e5..dd6caa66 100644 --- a/src/ftp-ls.c +++ b/src/ftp-ls.c @@ -851,6 +851,7 @@ ftp_index (const char *file, struct url *u, struct fileinfo *f) FILE *fp; char *upwd; char *htclfile; /* HTML-clean file name */ + char *urlclfile; /* URL-clean file name */ if (!output_stream) { @@ -923,13 +924,14 @@ ftp_index (const char *file, struct url *u, struct fileinfo *f) break; } htclfile = html_quote_string (f->name); + urlclfile = url_escape_unsafe_and_reserved (f->name); fprintf (fp, "host, u->port); if (*u->dir != '/') putc ('/', fp); fprintf (fp, "%s", u->dir); if (*u->dir) putc ('/', fp); - fprintf (fp, "%s", htclfile); + fprintf (fp, "%s", urlclfile); if (f->type == FT_DIRECTORY) putc ('/', fp); fprintf (fp, "\">%s", htclfile); @@ -942,6 +944,7 @@ ftp_index (const char *file, struct url *u, struct fileinfo *f) fprintf (fp, "-> %s", f->linkto ? f->linkto : "(nil)"); putc ('\n', fp); xfree (htclfile); + xfree (urlclfile); f = f->next; } fprintf (fp, "\n\n\n");