]> sjero.net Git - wget/blobdiff - src/main.c
Do not honor --config only when used as first long argument
[wget] / src / main.c
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;
         }
     }