mirror of
https://github.com/mirror/wget.git
synced 2025-01-24 03:10:07 +08:00
Applied Steven Schubiger's patch to use Gnulib's quote function in http.c.
This commit is contained in:
parent
bbe13a5b68
commit
92956183a7
@ -1,3 +1,9 @@
|
|||||||
|
2008-04-14 Steven Schubiger <schubiger@gmail.com>
|
||||||
|
|
||||||
|
* http.c: Use Gnulib's quote function for printing filenames and
|
||||||
|
such.
|
||||||
|
* wget.h: #include "quote.h".
|
||||||
|
|
||||||
2008-04-12 Rabin Vincent <rabin@rab.in>
|
2008-04-12 Rabin Vincent <rabin@rab.in>
|
||||||
|
|
||||||
* mswindows.c (fake_fork_child): Don't create a logfile for
|
* mswindows.c (fake_fork_child): Don't create a logfile for
|
||||||
|
42
src/http.c
42
src/http.c
@ -403,13 +403,13 @@ maybe_send_basic_creds (const char *hostname, const char *user,
|
|||||||
else if (basic_authed_hosts
|
else if (basic_authed_hosts
|
||||||
&& hash_table_contains(basic_authed_hosts, hostname))
|
&& hash_table_contains(basic_authed_hosts, hostname))
|
||||||
{
|
{
|
||||||
DEBUGP(("Found `%s' in basic_authed_hosts.\n", hostname));
|
DEBUGP(("Found %s in basic_authed_hosts.\n", quote (hostname)));
|
||||||
do_challenge = true;
|
do_challenge = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DEBUGP(("Host `%s' has not issued a general basic challenge.\n",
|
DEBUGP(("Host %s has not issued a general basic challenge.\n",
|
||||||
hostname));
|
quote (hostname)));
|
||||||
}
|
}
|
||||||
if (do_challenge)
|
if (do_challenge)
|
||||||
{
|
{
|
||||||
@ -430,7 +430,7 @@ register_basic_auth_host (const char *hostname)
|
|||||||
if (!hash_table_contains(basic_authed_hosts, hostname))
|
if (!hash_table_contains(basic_authed_hosts, hostname))
|
||||||
{
|
{
|
||||||
hash_table_put (basic_authed_hosts, xstrdup(hostname), NULL);
|
hash_table_put (basic_authed_hosts, xstrdup(hostname), NULL);
|
||||||
DEBUGP(("Inserted `%s' into basic_authed_hosts\n", hostname));
|
DEBUGP(("Inserted %s into basic_authed_hosts\n", quote (hostname)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1579,8 +1579,8 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
|
|||||||
post_data_size = file_size (opt.post_file_name);
|
post_data_size = file_size (opt.post_file_name);
|
||||||
if (post_data_size == -1)
|
if (post_data_size == -1)
|
||||||
{
|
{
|
||||||
logprintf (LOG_NOTQUIET, _("POST data file `%s' missing: %s\n"),
|
logprintf (LOG_NOTQUIET, _("POST data file %s missing: %s\n"),
|
||||||
opt.post_file_name, strerror (errno));
|
quote (opt.post_file_name), strerror (errno));
|
||||||
post_data_size = 0;
|
post_data_size = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1641,8 +1641,8 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
|
|||||||
{
|
{
|
||||||
request_free (req);
|
request_free (req);
|
||||||
logprintf(LOG_NOTQUIET,
|
logprintf(LOG_NOTQUIET,
|
||||||
_("%s: unable to resolve host address `%s'\n"),
|
_("%s: unable to resolve host address %s\n"),
|
||||||
exec_name, relevant->host);
|
exec_name, quote (relevant->host));
|
||||||
return HOSTERR;
|
return HOSTERR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1826,7 +1826,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
|
|||||||
/* If opt.noclobber is turned on and file already exists, do not
|
/* If opt.noclobber is turned on and file already exists, do not
|
||||||
retrieve the file */
|
retrieve the file */
|
||||||
logprintf (LOG_VERBOSE, _("\
|
logprintf (LOG_VERBOSE, _("\
|
||||||
File `%s' already there; not retrieving.\n\n"), hs->local_file);
|
File %s already there; not retrieving.\n\n"), quote (hs->local_file));
|
||||||
/* If the file is there, we suppose it's retrieved OK. */
|
/* If the file is there, we suppose it's retrieved OK. */
|
||||||
*dt |= RETROKF;
|
*dt |= RETROKF;
|
||||||
|
|
||||||
@ -2274,8 +2274,8 @@ File `%s' already there; not retrieving.\n\n"), hs->local_file);
|
|||||||
/* Print fetch message, if opt.verbose. */
|
/* Print fetch message, if opt.verbose. */
|
||||||
if (opt.verbose)
|
if (opt.verbose)
|
||||||
{
|
{
|
||||||
logprintf (LOG_NOTQUIET, _("Saving to: `%s'\n"),
|
logprintf (LOG_NOTQUIET, _("Saving to: %s\n"),
|
||||||
HYPHENP (hs->local_file) ? "STDOUT" : hs->local_file);
|
HYPHENP (hs->local_file) ? quote ("STDOUT") : quote (hs->local_file));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This confuses the timestamping code that checks for file size.
|
/* This confuses the timestamping code that checks for file size.
|
||||||
@ -2379,8 +2379,8 @@ http_loop (struct url *u, char **newloc, char **local_file, const char *referer,
|
|||||||
/* If opt.noclobber is turned on and file already exists, do not
|
/* If opt.noclobber is turned on and file already exists, do not
|
||||||
retrieve the file */
|
retrieve the file */
|
||||||
logprintf (LOG_VERBOSE, _("\
|
logprintf (LOG_VERBOSE, _("\
|
||||||
File `%s' already there; not retrieving.\n\n"),
|
File %s already there; not retrieving.\n\n"),
|
||||||
hstat.local_file);
|
quote (hstat.local_file));
|
||||||
/* If the file is there, we suppose it's retrieved OK. */
|
/* If the file is there, we suppose it's retrieved OK. */
|
||||||
*dt |= RETROKF;
|
*dt |= RETROKF;
|
||||||
|
|
||||||
@ -2507,8 +2507,8 @@ Spider mode enabled. Check if remote file exists.\n"));
|
|||||||
case FWRITEERR: case FOPENERR:
|
case FWRITEERR: case FOPENERR:
|
||||||
/* Another fatal error. */
|
/* Another fatal error. */
|
||||||
logputs (LOG_VERBOSE, "\n");
|
logputs (LOG_VERBOSE, "\n");
|
||||||
logprintf (LOG_NOTQUIET, _("Cannot write to `%s' (%s).\n"),
|
logprintf (LOG_NOTQUIET, _("Cannot write to %s (%s).\n"),
|
||||||
hstat.local_file, strerror (errno));
|
quote (hstat.local_file), strerror (errno));
|
||||||
case HOSTERR: case CONIMPOSSIBLE: case PROXERR: case AUTHFAILED:
|
case HOSTERR: case CONIMPOSSIBLE: case PROXERR: case AUTHFAILED:
|
||||||
case SSLINITFAILED: case CONTNOTSUPPORTED:
|
case SSLINITFAILED: case CONTNOTSUPPORTED:
|
||||||
/* Fatal errors just return from the function. */
|
/* Fatal errors just return from the function. */
|
||||||
@ -2630,8 +2630,8 @@ Last-modified header invalid -- time-stamp ignored.\n"));
|
|||||||
|| hstat.orig_file_size == hstat.contlen)
|
|| hstat.orig_file_size == hstat.contlen)
|
||||||
{
|
{
|
||||||
logprintf (LOG_VERBOSE, _("\
|
logprintf (LOG_VERBOSE, _("\
|
||||||
Server file no newer than local file `%s' -- not retrieving.\n\n"),
|
Server file no newer than local file %s -- not retrieving.\n\n"),
|
||||||
hstat.orig_file_name);
|
quote (hstat.orig_file_name));
|
||||||
ret = RETROK;
|
ret = RETROK;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
@ -2734,8 +2734,8 @@ Remote file exists.\n\n"));
|
|||||||
if (*dt & RETROKF)
|
if (*dt & RETROKF)
|
||||||
{
|
{
|
||||||
logprintf (LOG_VERBOSE,
|
logprintf (LOG_VERBOSE,
|
||||||
_("%s (%s) - `%s' saved [%s/%s]\n\n"),
|
_("%s (%s) - %s saved [%s/%s]\n\n"),
|
||||||
tms, tmrate, hstat.local_file,
|
tms, tmrate, quote (hstat.local_file),
|
||||||
number_to_static_string (hstat.len),
|
number_to_static_string (hstat.len),
|
||||||
number_to_static_string (hstat.contlen));
|
number_to_static_string (hstat.contlen));
|
||||||
logprintf (LOG_NONVERBOSE,
|
logprintf (LOG_NONVERBOSE,
|
||||||
@ -2765,8 +2765,8 @@ Remote file exists.\n\n"));
|
|||||||
if (*dt & RETROKF)
|
if (*dt & RETROKF)
|
||||||
{
|
{
|
||||||
logprintf (LOG_VERBOSE,
|
logprintf (LOG_VERBOSE,
|
||||||
_("%s (%s) - `%s' saved [%s]\n\n"),
|
_("%s (%s) - %s saved [%s]\n\n"),
|
||||||
tms, tmrate, hstat.local_file,
|
tms, tmrate, quote (hstat.local_file),
|
||||||
number_to_static_string (hstat.len));
|
number_to_static_string (hstat.len));
|
||||||
logprintf (LOG_NONVERBOSE,
|
logprintf (LOG_NONVERBOSE,
|
||||||
"%s URL:%s [%s] -> \"%s\" [%d]\n",
|
"%s URL:%s [%s] -> \"%s\" [%d]\n",
|
||||||
|
@ -212,7 +212,10 @@ typedef double SUM_SIZE_INT;
|
|||||||
|
|
||||||
/* Likewise for logging functions. */
|
/* Likewise for logging functions. */
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
|
/* Likewise for quoting functions. */
|
||||||
|
#include "quote.h"
|
||||||
|
|
||||||
/* Useful macros used across the code: */
|
/* Useful macros used across the code: */
|
||||||
|
|
||||||
/* The number of elements in an array. For example:
|
/* The number of elements in an array. For example:
|
||||||
|
Loading…
Reference in New Issue
Block a user