Another correction to string_transcode; this function now seems to work okay
(tested using a dummy 'encode' op added to my local copy of core.ops)

Peter Gibbs
EmKel Systems

Index: string.c
===================================================================
RCS file: /home/perlcvs/parrot/string.c,v
retrieving revision 1.35
diff -c -r1.35 string.c
*** string.c    1 Jan 2002 17:53:50 -0000       1.35
--- string.c    1 Jan 2002 21:21:22 -0000
***************
*** 179,185 ****
      srcstart = (void*)src->bufstart;
      srcend = srcstart + src->bufused;
      deststart = dest->bufstart;
!     destend = deststart + dest->buflen;

      while (srcstart < srcend) {
          INTVAL c = src->encoding->decode(srcstart);
--- 179,185 ----
      srcstart = (void*)src->bufstart;
      srcend = srcstart + src->bufused;
      deststart = dest->bufstart;
!     destend = deststart;

      while (srcstart < srcend) {
          INTVAL c = src->encoding->decode(srcstart);
***************
*** 187,193 ****
          if (transcoder1) c = transcoder1(c);
          if (transcoder2) c = transcoder2(c);

!         deststart = dest->encoding->encode(deststart, c);

          srcstart = src->encoding->skip_forward(srcstart, 1);
      }
--- 187,193 ----
          if (transcoder1) c = transcoder1(c);
          if (transcoder2) c = transcoder2(c);

!         destend = dest->encoding->encode(destend, c);

          srcstart = src->encoding->skip_forward(srcstart, 1);
      }


Reply via email to