X-Git-Url: http://sjero.net/git/?a=blobdiff_plain;f=src%2Fmain.c;h=268a603ffbd144375520bd59e0ab59998976f2b3;hb=a38d9e7e7a35d7d6ddfb3be4f2191eebc3f04a38;hp=3896afd005a349d5f190e8b50ed93bf8572adce1;hpb=1515ea0deaa4793c89f1608955c9c4031da8b459;p=wget diff --git a/src/main.c b/src/main.c index 3896afd0..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; @@ -743,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); } @@ -794,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), @@ -826,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) { @@ -834,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. */