From fa636eb71d95d92b7d4f9d618c7f4bfaf18d8a4c Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 10 Jan 2001 22:16:46 -0800 Subject: [PATCH] [svn] url.c (str_url): Clarified this function's comment header after Hrvoje answered my question on the list as to when hide != 1. Also Hrvoje pointed out I need to use xstrdup() on the string literal. --- src/ChangeLog | 6 ++++++ src/url.c | 11 ++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index be8bf28c..e1a6ffe7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2001-01-10 Dan Harkless + + * url.c (str_url): Clarified this function's comment header after + Hrvoje answered my question on the list as to when hide != 1. + Also Hrvoje pointed out I need to use xstrdup() on the string literal. + 2001-01-06 Hrvoje Niksic * connect.c (bindport): Declare addrlen as int. Diagnosed by diff --git a/src/url.c b/src/url.c index 6d166592..2ef99998 100644 --- a/src/url.c +++ b/src/url.c @@ -661,10 +661,11 @@ process_ftp_type (char *path) return '\0'; } -/* Return the URL as fine-formed string, with a proper protocol, - optional port number, directory and optional user/password. If - HIDE is non-zero, password will be hidden. The forbidden - characters in the URL will be cleansed. */ +/* Return the URL as fine-formed string, with a proper protocol, optional port + number, directory and optional user/password. If `hide' is non-zero (as it + is when we're calling this on a URL we plan to print, but not when calling it + to canonicalize a URL for use within the program), password will be hidden. + The forbidden characters in the URL will be cleansed. */ char * str_url (const struct urlinfo *u, int hide) { @@ -693,7 +694,7 @@ str_url (const struct urlinfo *u, int hide) shoulder (or in saved wget output). Don't give away the number of characters in the password, either, as we did in past versions of this code, when we replaced the password characters with 'x's. */ - passwd = ""; + passwd = xstrdup(""); else passwd = CLEANDUP (u->passwd); }