From: Jim Meyering Date: Sun, 15 Jan 2012 16:16:52 +0000 (+0100) Subject: avoid new warning about undefined $ARGV[0] X-Git-Tag: v2.68b~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75a5ef5c889bc7db3d560034338e99b2fc88f846;p=thirdparty%2Fautoconf.git avoid new warning about undefined $ARGV[0] * lib/Autom4te/General.pm (getopt): Avoid warning induced by yesterday's change: $ARGV[0] may not be defined, e.g., when invoked via autoreconf. --- diff --git a/ChangeLog b/ChangeLog index c5ccc043..2ab830e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-01-15 Jim Meyering + + avoid new warning about undefined $ARGV[0] + * lib/Autom4te/General.pm (getopt): Avoid warning induced by + yesterday's change: $ARGV[0] may not be defined, e.g., when + invoked via autoreconf. + 2011-01-14 Stefano Lattarini getopt: fix diagnostic for missing mandatory option argument diff --git a/lib/Autom4te/General.pm b/lib/Autom4te/General.pm index 5b48005a..2379ce32 100644 --- a/lib/Autom4te/General.pm +++ b/lib/Autom4te/General.pm @@ -270,7 +270,7 @@ sub getopt (%) # FIXME: Lot of code duplication with automake here. It would probably # be best to generalize our getopt() func and rip it out in a new module # from which automake can sync. - if ($ARGV[0] =~ /^-./) + if (defined $ARGV[0] && $ARGV[0] =~ /^-./) { my %argopts; for my $k (keys %option)