Skip to content

Commit

Permalink
Integrate:
Browse files Browse the repository at this point in the history
[ 21591]
Subject: [PATCH] Off-by-one error in regcomp.c
Message-Id: <1067602571.12768@devpc01.iconmobile.de>

[ 21593]
Test nit ; goes with change 21591
p4raw-link: @21593 on //depot/perl: d080832
p4raw-link: @21591 on //depot/perl: 197cf9b

p4raw-id: //depot/maint-5.8/perl@21606
p4raw-integrated: from //depot/perl@21605 'copy in'
	t/lib/warnings/regcomp (@15547..) t/op/regmesg.t (@15629..)
	'merge in' regcomp.c (@21433..)
  • Loading branch information
eserte authored and nwc10 committed Nov 1, 2003
1 parent cdeba5a commit b9bd2e2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion regcomp.c
Expand Up @@ -5037,7 +5037,7 @@ S_re_croak2(pTHX_ const char* pat1,const char* pat2,...)
if (l1 > 512)
l1 = 512;
Copy(message, buf, l1 , char);
buf[l1] = '\0'; /* Overwrite \n */
buf[l1-1] = '\0'; /* Overwrite \n */
Perl_croak(aTHX_ "%s", buf);
}

Expand Down
2 changes: 1 addition & 1 deletion t/lib/warnings/regcomp
Expand Up @@ -78,7 +78,7 @@ no warnings 'regexp' ;
/[.zog.]/;
EXPECT
POSIX syntax [. .] belongs inside character classes in regex; marked by <-- HERE in m/[.zog.] <-- HERE / at - line 5.
POSIX syntax [. .] is reserved for future extensions in regex; marked by <-- HERE in m/[.zog.] <-- HERE /
POSIX syntax [. .] is reserved for future extensions in regex; marked by <-- HERE in m/[.zog.] <-- HERE / at - line 5.
########
# regcomp.c [S_regclass]
$_ = "";
Expand Down
2 changes: 2 additions & 0 deletions t/op/regmesg.t
Expand Up @@ -131,6 +131,7 @@ while (@death)
chomp $@;
$result =~ s/{\#}/$marker1/;
$result =~ s/{\#}/$marker2/;
$result .= " at ";
if ($@ !~ /^\Q$result/) {
print "# For $regex, expected:\n# $result\n# Got:\n# $@\n#\nnot ";
}
Expand Down Expand Up @@ -164,6 +165,7 @@ while (@warning)
}
$result =~ s/{\#}/$marker1/;
$result =~ s/{\#}/$marker2/;
$result .= " at ";
if ($warning !~ /^\Q$result/)
{
print <<"EOM";
Expand Down

0 comments on commit b9bd2e2

Please sign in to comment.