From b844f03e71077069122b6f1194667733997dd055 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Thu, 15 Nov 2001 20:55:31 +0000 Subject: [PATCH] Upgrade to Getopt::Long 2.26_03. p4raw-id: //depot/perl@13026 --- lib/Getopt/Long.pm | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/lib/Getopt/Long.pm b/lib/Getopt/Long.pm index 6f3d18e..ea5aee6 100644 --- a/lib/Getopt/Long.pm +++ b/lib/Getopt/Long.pm @@ -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. -- 2.7.4