EBCDIC: more natification.
Jarkko Hietaniemi [Sun, 3 Feb 2002 18:33:53 +0000 (18:33 +0000)]
p4raw-id: //depot/perl@14540

regcomp.c

index c238f4e..2283d10 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -4052,20 +4052,23 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
                          ANYOF_BITMAP_SET(ret, i);
          }
          if (value > 255 || UTF) {
+               UV prevnatvalue  = NATIVE_TO_UNI(prevvalue);
+               UV natvalue      = NATIVE_TO_UNI(value);
+
                ANYOF_FLAGS(ret) |= ANYOF_UNICODE;
-               if (prevvalue < value)
+               if (prevnatvalue < natvalue) { /* what about > ? */
                    Perl_sv_catpvf(aTHX_ listsv, "%04"UVxf"\t%04"UVxf"\n",
-                                  (UV)prevvalue, (UV)value);
-               else if (prevvalue == value) {
-                   Perl_sv_catpvf(aTHX_ listsv, "%04"UVxf"\n",
-                                  (UV)value);
+                                  prevnatvalue, natvalue);
+               }
+               else if (prevnatvalue == natvalue) {
+                   Perl_sv_catpvf(aTHX_ listsv, "%04"UVxf"\n", natvalue);
                    if (FOLD) {
                         U8 tmpbuf [UTF8_MAXLEN+1];
                         U8 foldbuf[UTF8_MAXLEN_FOLD+1];
                         STRLEN foldlen;
                         UV f;
 
-                        uvchr_to_utf8(tmpbuf, NATIVE_TO_UNI(value));
+                        uvchr_to_utf8(tmpbuf, natvalue);
                         to_utf8_fold(tmpbuf, foldbuf, &foldlen);
                         f = UNI_TO_NATIVE(utf8_to_uvchr(foldbuf, 0));