diff options
author | Inaba Hiroto <inaba@st.rim.or.jp> | 1998-01-11 00:53:33 +0900 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-03-02 03:13:32 +0000 |
commit | f3ea7b5ee70397733e54550d64ca43f4288e744f (patch) | |
tree | a0e574cfde47c08fdcee740bda0c7e0d76fc6e79 /doop.c | |
parent | ecca16b0cfe0c7f04ba520f2924946a13507530e (diff) | |
download | perl-f3ea7b5ee70397733e54550d64ca43f4288e744f.tar.gz |
[win32] still another
Subject: [PERL] tr///s bug
Message-Id: <19980110155333D.inaba@st.rim.or.jp>
p4raw-id: //depot/win32/perl@613
Diffstat (limited to 'doop.c')
-rw-r--r-- | doop.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -29,6 +29,7 @@ do_trans(SV *sv, OP *arg) register I32 ch; register I32 matches = 0; register I32 squash = op->op_private & OPpTRANS_SQUASH; + register U8 *p; STRLEN len; if (SvREADONLY(sv) && !(op->op_private & OPpTRANS_COUNTONLY)) @@ -63,14 +64,16 @@ do_trans(SV *sv, OP *arg) } else { d = s; + p = send; while (s < send) { if ((ch = tbl[*s]) >= 0) { *d = ch; - if (matches++ && squash) { - if (d[-1] == *d) + matches++; + if (squash) { + if (p == d - 1 && *p == *d) matches--; else - d++; + p = d++; } else d++; |