In EBCDIC the UNI_TO_NATIVE() macro evaluates its argument
Jarkko Hietaniemi [Wed, 20 Feb 2002 22:15:23 +0000 (22:15 +0000)]
twice, causing the loop to skip every other character.

p4raw-id: //depot/perl@14800

utf8.c

diff --git a/utf8.c b/utf8.c
index 7dbb71f..6fc4acd 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -1341,8 +1341,10 @@ Perl_to_utf8_case(pTHX_ U8 *p, U8* ustrp, STRLEN *lenp, SV **swashp, char *norma
                        }
                   }
                   else {
-                       while (t < tend)
-                            d = uvchr_to_utf8(d, UNI_TO_NATIVE(*t++));
+                       while (t < tend) {
+                            d = uvchr_to_utf8(d, UNI_TO_NATIVE(*t));
+                            t++;
+                       }
                   }
                   len = d - tmpbuf;
                   Copy(tmpbuf, ustrp, len, U8);