as that of the covered work. */
#include "wget.h"
+#include "exits.h"
#include <stdio.h>
#include <stdlib.h>
#include "res.h" /* for res_cleanup */
#include "http.h" /* for http_cleanup */
#include "retr.h" /* for output_stream */
+#include "warc.h" /* for warc_close */
#ifdef TESTING
#include "test.h"
CMD_DECLARE (cmd_number);
CMD_DECLARE (cmd_number_inf);
CMD_DECLARE (cmd_string);
+CMD_DECLARE (cmd_string_uppercase);
CMD_DECLARE (cmd_file);
CMD_DECLARE (cmd_directory);
CMD_DECLARE (cmd_time);
{ "backups", &opt.backups, cmd_number },
{ "base", &opt.base_href, cmd_string },
{ "bindaddress", &opt.bind_address, cmd_string },
+ { "bodydata", &opt.body_data, cmd_string },
+ { "bodyfile", &opt.body_file, cmd_string },
#ifdef HAVE_SSL
{ "cacertificate", &opt.ca_cert, cmd_file },
#endif
#ifdef ENABLE_DEBUG
{ "debug", &opt.debug, cmd_boolean },
#endif
- { "defaultpage", &opt.default_page, cmd_string},
+ { "defaultpage", &opt.default_page, cmd_string },
{ "deleteafter", &opt.delete_after, cmd_boolean },
{ "dirprefix", &opt.dir_prefix, cmd_directory },
{ "dirstruct", NULL, cmd_spec_dirstruct },
{ "logfile", &opt.lfilename, cmd_file },
{ "login", &opt.ftp_user, cmd_string },/* deprecated*/
{ "maxredirect", &opt.max_redirect, cmd_number },
+ { "method", &opt.method, cmd_string_uppercase },
{ "mirror", NULL, cmd_spec_mirror },
{ "netrc", &opt.netrc, cmd_boolean },
{ "noclobber", &opt.noclobber, cmd_boolean },
return true;
}
+/* Like cmd_string but ensure the string is upper case. */
+static bool
+cmd_string_uppercase (const char *com, const char *val, void *place)
+{
+ char *q;
+ bool ret = cmd_string (com, val, place);
+ q = *((char **) place);
+ if (!ret || q == NULL)
+ return false;
-/* Like the above, but handles tilde-expansion when reading a user's
+ for ( ;*q; *q++)
+ *q = c_toupper (*q);
+
+ return true;
+}
+
+
+/* Like cmd_string, but handles tilde-expansion when reading a user's
`.wgetrc'. In that case, and if VAL begins with `~', the tilde
gets expanded to the user's home directory. */
static bool
\f
void cleanup_html_url (void);
+void spider_cleanup (void);
/* Free the memory allocated by global variables. */
log_close ();
if (output_stream)
- fclose (output_stream);
+ if (fclose (output_stream) == EOF)
+ inform_exit_status (CLOSEFAILED);
+
/* No need to check for error because Wget flushes its output (and
checks for errors) after any data arrives. */
res_cleanup ();
http_cleanup ();
cleanup_html_url ();
+ spider_cleanup ();
host_cleanup ();
log_cleanup ();
xfree_null (opt.user);
xfree_null (opt.passwd);
xfree_null (opt.base_href);
+ xfree_null (opt.method);
#endif /* DEBUG_MALLOC */
}