From 1a022742724e89e02aeab011ec7e5ea9cc8279f8 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 23 May 2018 15:14:03 +0100 Subject: [PATCH] Fix a Perl warning when mkfiles.pl gets bad input. If you forget the '+' at the start of a continuation line with only one word on it, then Perl would test $_[1] before checking that it even existed to test. The test would give the right answer anyway, but the warning was annoying. --- mkfiles.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkfiles.pl b/mkfiles.pl index a0a78fee..76b29a25 100755 --- a/mkfiles.pl +++ b/mkfiles.pl @@ -122,12 +122,12 @@ while () { $listref = $lastlistref; $prog = undef; die "$.: unexpected + line\n" if !defined $lastlistref; - } elsif ($_[1] eq "=") { + } elsif ($#_ >= 1 && $_[1] eq "=") { $groups{$_[0]} = [] if !defined $groups{$_[0]}; $listref = $groups{$_[0]}; $prog = undef; shift @objs; # eat the group name - } elsif ($_[1] eq ":") { + } elsif ($#_ >= 1 && $_[1] eq ":") { $listref = []; $prog = $_[0]; shift @objs; # eat the program name