+ const char *options_title = "Options : ";
+ const char *wgetrc_title = "Wgetrc : ";
+ const char *locale_title = "Locale : ";
+ const char *compile_title = "Compile : ";
+ const char *link_title = "Link : ";
+ const char *prefix_spaces = " ";
+ const int prefix_space_length = strlen (prefix_spaces);
+
+ printf ("GNU Wget %s\n", version_string);
+ printf (options_title);
+ /* compiled_features is a char*[]. We limit the characters per
+ line to max_chars_per_line and prefix each line with a constant
+ number of spaces for proper alignment. */
+ int i =0;
+ for (i = 0; compiled_features[i] != NULL; )
+ {
+ int line_length = max_chars_per_line - prefix_space_length;
+ while ((line_length > 0) && (compiled_features[i] != NULL))
+ {
+ printf ("%s ", compiled_features[i]);
+ line_length -= strlen (compiled_features[i]) + 2;
+ i++;
+ }
+ printf ("\n");
+ if (compiled_features[i] != NULL)
+ {
+ printf (prefix_spaces);
+ }
+ }
+ /* Handle the case when $WGETRC is unset and $HOME/.wgetrc is
+ absent. */
+ printf (wgetrc_title);
+ char *env_wgetrc = wgetrc_env_file_name ();
+ if (env_wgetrc && *env_wgetrc)
+ {
+ printf ("%s (env)\n%s", env_wgetrc, prefix_spaces);
+ xfree (env_wgetrc);
+ }
+ char *user_wgetrc = wgetrc_user_file_name ();
+ if (user_wgetrc)
+ {
+ printf ("%s (user)\n%s", user_wgetrc, prefix_spaces);
+ xfree (user_wgetrc);
+ }
+ printf ("%s (system)\n", system_wgetrc);
+
+ format_and_print_line (strdup (locale_title),
+ strdup (locale_dir),
+ max_chars_per_line);
+
+ format_and_print_line (strdup (compile_title),
+ strdup (compilation_string),
+ max_chars_per_line);
+
+ format_and_print_line (strdup (link_title),
+ strdup (link_string),
+ max_chars_per_line);
+ printf ("\n");