In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/e95a9fc214b6cb4aa721db3682e902f327e354f2?hp=a9bec28731f6ff92754c2d5febd8958a20ef8e7e>

- Log -----------------------------------------------------------------
commit e95a9fc214b6cb4aa721db3682e902f327e354f2
Author: Karl Williamson <k...@khw-desktop.(none)>
Date:   Sat Jul 24 10:46:45 2010 -0600

    warnings.pl: Silence perl compiler warnings
    
    warnings.pl was trying to read two beyond the end of an array.
-----------------------------------------------------------------------

Summary of changes:
 warnings.pl |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/warnings.pl b/warnings.pl
index ea6e144..e57ed1f 100644
--- a/warnings.pl
+++ b/warnings.pl
@@ -168,13 +168,13 @@ sub mkRange
 {
     my @a = @_ ;
     my @out = @a ;
-    my $i ;
 
-
-    for ($i = 1 ; $i < @a; ++ $i) {
+    for my $i (1 .. @a - 1) {
        $out[$i] = ".."
-          if $a[$i] == $a[$i - 1] + 1 && $a[$i] + 1 == $a[$i + 1] ;
+          if $a[$i] == $a[$i - 1] + 1
+             && ($i >= @a  - 1 || $a[$i] + 1 == $a[$i + 1] );
     }
+    $out[-1] = $a[-1] if $out[-1] eq "..";
 
     my $out = join(",",@out);
 

--
Perl5 Master Repository

Reply via email to