X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Furl.c;h=86d099a7190b80aaec8bc1cf6771c49892364602;hp=8f0672503f07fdfef8cde9b8b4093b4b63841c71;hb=1b4ed7dcb7bdad277a9ee2c5a42b6e70854db802;hpb=66dd4bda74bb78915b92cac4e7bfd32a3fe9d957 diff --git a/src/url.c b/src/url.c index 8f067250..86d099a7 100644 --- a/src/url.c +++ b/src/url.c @@ -252,6 +252,15 @@ url_escape (const char *s) return url_escape_1 (s, urlchr_unsafe, false); } +/* URL-escape the unsafe and reserved characters (see urlchr_table) in + a given string, returning a freshly allocated string. */ + +char * +url_escape_unsafe_and_reserved (const char *s) +{ + return url_escape_1 (s, urlchr_unsafe|urlchr_reserved, false); +} + /* URL-escape the unsafe characters (see urlchr_table) in a given string. If no characters are unsafe, S is returned. */ @@ -929,9 +938,9 @@ url_error (const char *url, int error_code) if ((p = strchr (scheme, ':'))) *p = '\0'; if (!strcasecmp (scheme, "https")) - asprintf (&error, _("HTTPS support not compiled in")); + error = aprintf (_("HTTPS support not compiled in")); else - asprintf (&error, _(parse_errors[error_code]), quote (scheme)); + error = aprintf (_(parse_errors[error_code]), quote (scheme)); xfree (scheme); return error;