X-Git-Url: http://sjero.net/git/?a=blobdiff_plain;f=src%2Fmain.c;h=268a603ffbd144375520bd59e0ab59998976f2b3;hb=a38d9e7e7a35d7d6ddfb3be4f2191eebc3f04a38;hp=277dd0e969e7ad85c327370952aa9d775e042b0f;hpb=dc9abe478f8175d342f190993d0dc61891a7da8e;p=wget diff --git a/src/main.c b/src/main.c index 277dd0e9..268a603f 100644 --- a/src/main.c +++ b/src/main.c @@ -72,8 +72,6 @@ extern char *system_getrc; extern char *link_string; /* defined in build_info.c */ extern char *compiled_features[]; -extern char *system_wgetrc; -extern char *locale_dir; /* Used for --version output in print_version */ static const int max_chars_per_line = 72; @@ -514,6 +512,9 @@ HTTP options:\n"), --http-password=PASS set http password to PASS.\n"), N_("\ --no-cache disallow server-cached data.\n"), + N_ ("\ + --default-page=NAME Change the default page name (normally\n\ + this is `index.html'.).\n"), N_("\ -E, --html-extension save HTML documents with `.html' extension.\n"), N_("\ @@ -740,6 +741,10 @@ format_and_print_line (char* prefix, char* line, } printf ("\n"); + + /* FIXME: Responsibility for deallocation should be handled by + whatever allocated it, wherever possible. These two lines result + in unnecessary strdup calls in the print_version function. */ xfree (prefix); xfree (line); } @@ -791,10 +796,12 @@ print_version (void) printf ("%s (user)\n%s", user_wgetrc, prefix_spaces); xfree (user_wgetrc); } - printf ("%s (system)\n", system_wgetrc); +#ifdef SYSTEM_WGETRC + printf ("%s (system)\n", SYSTEM_WGETRC); +#endif format_and_print_line (strdup (locale_title), - strdup (locale_dir), + strdup (LOCALEDIR), max_chars_per_line); format_and_print_line (strdup (compile_title), @@ -823,6 +830,8 @@ There is NO WARRANTY, to the extent permitted by law.\n"), stdout); exit (0); } +char *program_name; /* Needed by lib/error.c. */ + int main (int argc, char **argv) { @@ -831,6 +840,8 @@ main (int argc, char **argv) int nurl, status; bool append_to_log = false; + program_name = argv[0]; + i18n_initialize (); /* Construct the name of the executable, without the directory part. */ @@ -1238,9 +1249,6 @@ WARNING: Can't reopen standard output in binary mode;\n\ xfree (url[i]); cleanup (); -#ifdef DEBUG_MALLOC - print_malloc_debug_stats (); -#endif if (status == RETROK) return 0; else