[Pcre-svn] [1027] code/trunk: Fix typos in code for alphabet…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [1027] code/trunk: Fix typos in code for alphabetic ranges in EBCDIC environments.
Revision: 1027
          http://www.exim.org/viewvc/pcre2?view=rev&revision=1027
Author:   ph10
Date:     2018-10-15 12:01:24 +0100 (Mon, 15 Oct 2018)
Log Message:
-----------
Fix typos in code for alphabetic ranges in EBCDIC environments.


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/src/pcre2_compile.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2018-10-14 15:56:36 UTC (rev 1026)
+++ code/trunk/ChangeLog    2018-10-15 11:01:24 UTC (rev 1027)
@@ -33,7 +33,11 @@
 8. Implement the new Perl "script run" features (*script_run:...) and 
 (*atomic_script_run:...) aka (*sr:...) and (*asr:...).


+9. Fixed two typos in change 22 for 10.21, which added special handling for
+ranges such as a-z in EBCDIC environments. The original code probably never
+worked, though there were no bug reports.

+
Version 10.32 10-September-2018
-------------------------------


Modified: code/trunk/src/pcre2_compile.c
===================================================================
--- code/trunk/src/pcre2_compile.c    2018-10-14 15:56:36 UTC (rev 1026)
+++ code/trunk/src/pcre2_compile.c    2018-10-15 11:01:24 UTC (rev 1027)
@@ -1937,9 +1937,9 @@
     c ^= 0x40;


     /* Handle \c in an EBCDIC environment. The special case \c? is converted to
-    255 (0xff) or 95 (0x5f) if other character suggest we are using th POSIX-BC
-    encoding. (This is the way Perl indicates that it handles \c?.) The other
-    valid sequences correspond to a list of specific characters. */
+    255 (0xff) or 95 (0x5f) if other characters suggest we are using the
+    POSIX-BC encoding. (This is the way Perl indicates that it handles \c?.)
+    The other valid sequences correspond to a list of specific characters. */


 #else
     if (c == CHAR_QUESTION_MARK)
@@ -5710,10 +5710,10 @@
           if (range_is_literal &&
                (cb->ctypes[c] & ctype_letter) != 0 &&
                (cb->ctypes[d] & ctype_letter) != 0 &&
-               (d <= CHAR_z) == (d <= CHAR_z))
+               (c <= CHAR_z) == (d <= CHAR_z))
             {
             uint32_t uc = (d <= CHAR_z)? 0 : 64;
-            uint32_t C = d - uc;
+            uint32_t C = c - uc;
             uint32_t D = d - uc;


             if (C <= CHAR_i)