]> sjero.net Git - wget/blobdiff - src/init.c
[svn] Merging fix #20499: MAX_REDIRECTIONS should be configurable.
[wget] / src / init.c
index 32e9ea4fdaa00360225f07a37ec733b274343cbc..7f8115638425e0785205afacd99a36b85aa28edd 100644 (file)
@@ -5,7 +5,7 @@ This file is part of GNU Wget.
 
 GNU Wget is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
+the Free Software Foundation; either version 3 of the License, or
 (at your option) any later version.
 
 GNU Wget is distributed in the hope that it will be useful,
@@ -14,8 +14,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with Wget; if not, write to the Free Software Foundation, Inc.,
-51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+along with Wget.  If not, see <http://www.gnu.org/licenses/>.
 
 In addition, as a special exception, the Free Software Foundation
 gives permission to link the code of its release of Wget with the
@@ -183,6 +182,7 @@ static struct {
   { "loadcookies",     &opt.cookies_input,     cmd_file },
   { "logfile",         &opt.lfilename,         cmd_file },
   { "login",           &opt.ftp_user,          cmd_string },/* deprecated*/
+  { "maxredirect",     &opt.max_redirect,      cmd_number },
   { "mirror",          NULL,                   cmd_spec_mirror },
   { "netrc",           &opt.netrc,             cmd_boolean },
   { "noclobber",       &opt.noclobber,         cmd_boolean },
@@ -322,6 +322,7 @@ defaults (void)
   opt.restrict_files_case = restrict_no_case_restriction;
 
   opt.content_disposition = true;
+  opt.max_redirect = 20;
 }
 \f
 /* Return the user's home directory (strdup-ed), or NULL if none is
@@ -1135,10 +1136,11 @@ cmd_spec_prefer_family (const char *com, const char *val, void *place_ignored)
     { "IPv6", prefer_ipv6 },
     { "none", prefer_none },
   };
-  int ok = decode_string (val, choices, countof (choices),
-                         (int *) &opt.prefer_family);
+  int prefer_family = prefer_ipv4;
+  int ok = decode_string (val, choices, countof (choices), &prefer_family);
   if (!ok)
     fprintf (stderr, _("%s: %s: Invalid value `%s'.\n"), exec_name, com, val);
+  opt.prefer_family = prefer_family;
   return ok;
 }