]> sjero.net Git - wget/commitdiff
Do not honor --config only when used as first long argument
authorGiuseppe Scrivano <gscrivano@gnu.org>
Sun, 9 Dec 2012 16:04:39 +0000 (17:04 +0100)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Sun, 9 Dec 2012 16:04:57 +0000 (17:04 +0100)
src/ChangeLog
src/main.c

index 9f52e8e00b70dfc184ffd8cb2d16691a8f8fb21f..df9101367c92ca77ce1c6d45eb26408219a9b5f5 100644 (file)
@@ -1,5 +1,9 @@
 2012-12-09  Giuseppe Scrivano  <gscrivano@gnu.org>
 
+       * main.c (main): Keep looking for "config" until there are
+       arguments to parse.
+       Reported by: Adrien Dumont <adr.dum@hotmail.fr>
+
        * test.c: Include "wget.h".
 
 2012-12-08  Michael Stapelberg <michael@stapelberg.de> (tiny change)
index 4c2eb45b29286945bc1ea1e1c14e591537860d6d..992f60a05dc555cba70b123274804163e792bdc1 100644 (file)
@@ -1034,7 +1034,6 @@ main (int argc, char **argv)
                                 short_options, long_options, &longindex)) != -1)
     {
       int confval;
-      bool userrc_ret = true;
       struct cmdline_option *config_opt;
 
       /* There is no short option for "--config". */
@@ -1044,16 +1043,17 @@ main (int argc, char **argv)
           config_opt = &option_data[confval & ~BOOLEAN_NEG_MARKER];
           if (strcmp (config_opt->long_name, "config") == 0)
             {
+              bool userrc_ret = true;
               userrc_ret &= run_wgetrc (optarg);
               use_userconfig = true;
+              if (userrc_ret)
+                break;
+              else
+                {
+                  fprintf (stderr, _("Exiting due to error in %s\n"), optarg);
+                  exit (2);
+                }
             }
-          if (!userrc_ret)
-            {
-              fprintf (stderr, _("Exiting due to error in %s\n"), optarg);
-              exit (2);
-            }
-          else
-            break;
         }
     }