summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2001-12-06 11:06:01 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-06 14:23:06 +0000
commitc35ba56d0568c1f3444c4bf4a401227442dc193f (patch)
tree1f4072484e2b579bda57c76388083a357ad9d1c6 /op.c
parentd816c1805b681ac3d7f15aed7127d03d660d5db4 (diff)
downloadperl-c35ba56d0568c1f3444c4bf4a401227442dc193f.tar.gz
Re: counting tr thinks it's modifying
Message-Id: <slrna0ukap.kbt.rgarciasuarez@rafael.kazibao.net> p4raw-id: //depot/perl@13486
Diffstat (limited to 'op.c')
-rw-r--r--op.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/op.c b/op.c
index 8125b308ce..85ff67b2b6 100644
--- a/op.c
+++ b/op.c
@@ -2936,6 +2936,9 @@ Perl_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
if (!squash)
o->op_private |= OPpTRANS_IDENTICAL;
}
+ else if (!squash && rlen == tlen && memEQ((char*)t, (char*)r, tlen)) {
+ o->op_private |= OPpTRANS_IDENTICAL;
+ }
for (i = 0; i < 256; i++)
tbl[i] = -1;
for (i = 0, j = 0; i < tlen; i++,j++) {