]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
avoid new warning about undefined $ARGV[0]
authorJim Meyering <meyering@redhat.com>
Sun, 15 Jan 2012 16:16:52 +0000 (17:16 +0100)
committerJim Meyering <meyering@redhat.com>
Sun, 15 Jan 2012 16:16:52 +0000 (17:16 +0100)
* lib/Autom4te/General.pm (getopt): Avoid warning induced by
yesterday's change: $ARGV[0] may not be defined, e.g., when
invoked via autoreconf.

ChangeLog
lib/Autom4te/General.pm

index c5ccc043d9de128f423609f8d2ddf9c34335ef4e..2ab830e9dd1cc5a2ea234a61fdb9cfe3ab39821d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-01-15  Jim Meyering  <meyering@redhat.com>
+
+       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  <stefano.lattarini@gmail.com>
 
        getopt: fix diagnostic for missing mandatory option argument
index 5b48005ae4d49e275d41e37cd10c7e36f514e3b0..2379ce3261d81cb943e235d2d86abfc8a02ee9ab 100644 (file)
@@ -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)