summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters.nicoh.com>1996-01-12 02:05:05 +0000
committerAndy Dougherty <doughera.lafayette.edu>1996-01-12 02:05:05 +0000
commitec49126f00eaabb606bdcd4eeb8b52e059921952 (patch)
tree68c7e94b54a072c6cae7c136d307076bd41efabf /op.c
parent37b42002e388d000fa8e50e1bd4503f5c47c393f (diff)
downloadperl-ec49126f00eaabb606bdcd4eeb8b52e059921952.tar.gz
Chip's U8/STDCHAR patch.
Diffstat (limited to 'op.c')
-rw-r--r--op.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/op.c b/op.c
index 9ae1bdcde1..5c9923a631 100644
--- a/op.c
+++ b/op.c
@@ -1722,8 +1722,8 @@ OP *repl;
SV *rstr = ((SVOP*)repl)->op_sv;
STRLEN tlen;
STRLEN rlen;
- register char *t = SvPV(tstr, tlen);
- register char *r = SvPV(rstr, rlen);
+ register U8 *t = (U8*)SvPV(tstr, tlen);
+ register U8 *r = (U8*)SvPV(rstr, rlen);
register I32 i;
register I32 j;
I32 delete;
@@ -1738,19 +1738,19 @@ OP *repl;
if (complement) {
Zero(tbl, 256, short);
for (i = 0; i < tlen; i++)
- tbl[t[i] & 0377] = -1;
+ tbl[t[i]] = -1;
for (i = 0, j = 0; i < 256; i++) {
if (!tbl[i]) {
if (j >= rlen) {
if (delete)
tbl[i] = -2;
else if (rlen)
- tbl[i] = r[j-1] & 0377;
+ tbl[i] = r[j-1];
else
tbl[i] = i;
}
else
- tbl[i] = r[j++] & 0377;
+ tbl[i] = r[j++];
}
}
}
@@ -1763,14 +1763,14 @@ OP *repl;
for (i = 0, j = 0; i < tlen; i++,j++) {
if (j >= rlen) {
if (delete) {
- if (tbl[t[i] & 0377] == -1)
- tbl[t[i] & 0377] = -2;
+ if (tbl[t[i]] == -1)
+ tbl[t[i]] = -2;
continue;
}
--j;
}
- if (tbl[t[i] & 0377] == -1)
- tbl[t[i] & 0377] = r[j] & 0377;
+ if (tbl[t[i]] == -1)
+ tbl[t[i]] = r[j];
}
}
op_free(expr);