X-Git-Url: http://sjero.net/git/?a=blobdiff_plain;f=src%2Fretr.c;h=f081d83160e332275ad3231b6cdc2ab9cc5fd905;hb=766df9d4e9392045a4e5c730ed81e599b509557a;hp=857742979e397748f3932d566d77ecf0d89dcd7b;hpb=0fae9cb3887905279e22acd65ce639a1e5f56cc6;p=wget diff --git a/src/retr.c b/src/retr.c index 85774297..f081d831 100644 --- a/src/retr.c +++ b/src/retr.c @@ -393,7 +393,7 @@ fd_read_hunk (int fd, hunk_terminator_t terminator, long sizehint, long maxsize) char *hunk = xmalloc (bufsize); int tail = 0; /* tail position in HUNK */ - assert (maxsize >= bufsize); + assert (!maxsize || maxsize >= bufsize); while (1) { @@ -1070,3 +1070,16 @@ no_proxy_match (const char *host, const char **no_proxy) else return sufmatch (no_proxy, host); } + +/* Set the file parameter to point to the local file string. */ +void +set_local_file (const char **file, const char *default_file) +{ + if (opt.output_document) + { + if (output_stream_regular) + *file = opt.output_document; + } + else + *file = default_file; +}