Fix undeclared loop variable in Perl test suite

Reported-by: Hubert Tarasiuk <hubert.tarasiuk@gmail.com>
This commit is contained in:
Pär Karlsson 2015-05-19 22:20:17 +02:00 committed by Tim Rühsen
parent 8682c2612f
commit 83537f2415
1 changed files with 4 additions and 4 deletions

View File

@ -265,13 +265,12 @@ sub _show_diff
my $min = $explen <= $actlen ? $explen : $actlen;
my $line = 1;
my $col = 1;
my $i;
my $i = 0;
# for ($i=0; $i != $min; ++$i) {
for my $i (0 .. $min - 1)
while ( $i < $min )
{
last if substr($expected, $i, 1) ne substr $actual, $i, 1;
if (substr($expected, $i, 1) eq q{\n})
if (substr($expected, $i, 1) eq "\n")
{
$line++;
$col = 0;
@ -280,6 +279,7 @@ sub _show_diff
{
$col++;
}
$i++;
}
my $snip_start = $i - ($SNIPPET_SIZE / 2);
if ($snip_start < 0)