]> sjero.net Git - wget/commitdiff
[svn] Fix "lockable boolean" error message.
authorhniksic <devnull@localhost>
Sun, 19 Jun 2005 14:08:09 +0000 (07:08 -0700)
committerhniksic <devnull@localhost>
Sun, 19 Jun 2005 14:08:09 +0000 (07:08 -0700)
src/ChangeLog
src/init.c

index 2b62712dd335a93a00381e781bb04d1fa68a66d1..c2d9350c40b483d001c9834b85499cf1b33070fe 100644 (file)
@@ -1,3 +1,10 @@
+2005-06-19  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * init.c (cmd_lockable_boolean): Don't recognize literal "2" and
+       "-1" values; unlike 0 and 1, those should never be exposed to the
+       user.  Update the error message to be more self-consistent, as
+       proposed by Benno Schulenberg.
+
 2005-06-18  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * http.c (gethttp): Don't free "head" before using it to save
index b0e2c592462ba2466283390ab12ab916d6e45980..80dc818f8aa37e3d59ddb6f28a2951ab643caddd 100644 (file)
@@ -704,7 +704,7 @@ cmd_boolean (const char *com, const char *val, void *place)
   else
     {
       fprintf (stderr,
-              _("%s: %s: Invalid boolean `%s', use `on' or `off'.\n"),
+              _("%s: %s: Invalid boolean `%s'; use `on' or `off'.\n"),
               exec_name, com, val);
       return 0;
     }
@@ -721,7 +721,16 @@ cmd_boolean (const char *com, const char *val, void *place)
    Values: 2 - Enable a particular option for good ("always")
            1 - Enable an option ("on")
            0 - Disable an option ("off")
-          -1 - Disable an option for good ("never") */
+          -1 - Disable an option for good ("never")
+
+   #### This hack is currently only used for passive FTP because a
+   contributor had broken scripts specify --passive-ftp where he
+   didn't want it.  It should be removed because the same can now be
+   achieved by replacing the wget executable with a script containing:
+
+       exec wget "$@" --no-passive-ftp
+*/
+
 static int
 cmd_lockable_boolean (const char *com, const char *val, void *place)
 {
@@ -736,18 +745,19 @@ cmd_lockable_boolean (const char *com, const char *val, void *place)
   if (oldval == -1 || oldval == 2)
     return 1;
 
-  if (0 == strcasecmp (val, "always") || CMP1 (val, '2'))
-    lockable_boolean_value = 2;
-  else if (CMP2 (val, 'o', 'n') || CMP3 (val, 'y', 'e', 's') || CMP1 (val, '1'))
+  if (CMP2 (val, 'o', 'n') || CMP3 (val, 'y', 'e', 's') || CMP1 (val, '1'))
     lockable_boolean_value = 1;
   else if (CMP3 (val, 'o', 'f', 'f') || CMP2 (val, 'n', 'o') || CMP1 (val, '0'))
     lockable_boolean_value = 0;
-  else if (0 == strcasecmp (val, "never") || CMP2 (val, '-', '1'))
+  else if (0 == strcasecmp (val, "always"))
+    lockable_boolean_value = 2;
+  else if (0 == strcasecmp (val, "never"))
     lockable_boolean_value = -1;
   else
     {
       fprintf (stderr,
-              _("%s: %s: Invalid boolean `%s'; use on, off, always, or never.\n"),
+              _("%s: %s: Invalid extended boolean `%s';\n\
+use one of `on', `off', `always', or `never'.\n"),
               exec_name, com, val);
       return 0;
     }