diff options
author | Perl 5 Porters <perl5-porters.nicoh.com> | 1996-01-12 02:05:05 +0000 |
---|---|---|
committer | Andy Dougherty <doughera.lafayette.edu> | 1996-01-12 02:05:05 +0000 |
commit | ec49126f00eaabb606bdcd4eeb8b52e059921952 (patch) | |
tree | 68c7e94b54a072c6cae7c136d307076bd41efabf /op.c | |
parent | 37b42002e388d000fa8e50e1bd4503f5c47c393f (diff) | |
download | perl-ec49126f00eaabb606bdcd4eeb8b52e059921952.tar.gz |
Chip's U8/STDCHAR patch.
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -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); |