]> sjero.net Git - wget/commitdiff
[svn] url.c (str_url): Clarified this function's comment header after Hrvoje answered
authordan <devnull@localhost>
Thu, 11 Jan 2001 06:16:46 +0000 (22:16 -0800)
committerdan <devnull@localhost>
Thu, 11 Jan 2001 06:16:46 +0000 (22:16 -0800)
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
src/url.c

index be8bf28c2ead6929d802643fc091fa9fc852eb19..e1a6ffe77e65680e2d559f1adb2ec588a626a755 100644 (file)
@@ -1,3 +1,9 @@
+2001-01-10  Dan Harkless  <wget@harkless.org>
+
+       * 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  <hniksic@arsdigita.com>
 
        * connect.c (bindport): Declare addrlen as int.  Diagnosed by
index 6d166592d261b51cb1eda4b57cbd823997e17c11..2ef99998d92ffe5064c0b293fabcbabcbfd9bc26 100644 (file)
--- a/src/url.c
+++ b/src/url.c
@@ -661,10 +661,11 @@ process_ftp_type (char *path)
     return '\0';
 }
 \f
-/* 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 = "<password>";
+       passwd = xstrdup("<password>");
       else
        passwd = CLEANDUP (u->passwd);
     }