Re: [ID 20020213.015] Pod::Html XHTML update for 5.7.2
[p5sagit/p5-mst-13.2.git] / lib / Getopt / Long.pm
index 957c272..ea5aee6 100644 (file)
@@ -2,12 +2,12 @@
 
 package Getopt::Long;
 
-# RCS Status      : $Id: GetoptLong.pm,v 2.45 2001-09-27 17:39:47+02 jv Exp $
+# RCS Status      : $Id: GetoptLong.pm,v 2.47 2001-11-15 18:14:22+01 jv Exp $
 # Author          : Johan Vromans
 # Created On      : Tue Sep 11 15:00:12 1990
 # Last Modified By: Johan Vromans
-# Last Modified On: Thu Sep 27 17:38:47 2001
-# Update Count    : 980
+# Last Modified On: Thu Nov 15 18:13:36 2001
+# Update Count    : 987
 # Status          : Released
 
 ################ Copyright ################
@@ -35,10 +35,10 @@ use 5.004;
 use strict;
 
 use vars qw($VERSION);
-$VERSION        =  2.26_02;
+$VERSION        =  2.26_03;
 # For testing versions only.
 use vars qw($VERSION_STRING);
-$VERSION_STRING = "2.26_02";
+$VERSION_STRING = "2.26_03";
 
 use Exporter;
 
@@ -257,7 +257,7 @@ sub GetOptions {
     $error = '';
 
     print STDERR ("GetOpt::Long $Getopt::Long::VERSION (",
-                 '$Revision: 2.45 $', ") ",
+                 '$Revision: 2.47 $', ") ",
                  "called from package \"$pkg\".",
                  "\n  ",
                  "ARGV: (@ARGV)",
@@ -723,11 +723,12 @@ sub FindOption ($$$$) {
 
     if ( $bundling && $starter eq '-' ) {
 
-       # To try overides, obey case ignore.
+       # To try overrides, obey case ignore.
        $tryopt = $ignorecase ? lc($opt) : $opt;
 
        # If bundling == 2, long options can override bundles.
-       if ( $bundling == 2 && defined ($opctl->{$tryopt}) ) {
+       if ( $bundling == 2 && length($tryopt) > 1
+            && defined ($opctl->{$tryopt}) ) {
            print STDERR ("=> $starter$tryopt overrides unbundling\n")
              if $debug;
        }
@@ -832,11 +833,9 @@ sub FindOption ($$$$) {
     my $mand = $ctl->[CTL_MAND];
 
     # Check if there is an option argument available.
-    if ( $gnu_compat ) {
-       return (1, $opt, $ctl, $optarg)
-         if defined $optarg;
-       return (1, $opt, $ctl, $type eq "s" ? '' : 0)
-         unless $mand;
+    if ( $gnu_compat && defined $optarg && $optarg eq "" ) {
+       return (1, $opt, $ctl, $type eq "s" ? "" : 0) unless $mand;
+       $optarg = 0 unless $type eq "s";
     }
 
     # Check if there is an option argument available.
@@ -1193,7 +1192,7 @@ STDERR, and return a false result.
 Getopt::Long supports two useful variants of simple options:
 I<negatable> options and I<incremental> options.
 
-A negatable option is specified with a exclamation mark C<!> after the
+A negatable option is specified with an exclamation mark C<!> after the
 option name:
 
     my $verbose = '';  # option variable with default value (false)