Fix typos in code for alphabetic ranges in EBCDIC environments.

This commit is contained in:
Philip.Hazel 2018-10-15 11:01:24 +00:00
parent 2ba22647d1
commit 971f885277
2 changed files with 9 additions and 5 deletions

View File

@ -33,6 +33,10 @@ src/pcre2_chartables.c.dist are updated.
8. Implement the new Perl "script run" features (*script_run:...) and 8. Implement the new Perl "script run" features (*script_run:...) and
(*atomic_script_run:...) aka (*sr:...) and (*asr:...). (*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 Version 10.32 10-September-2018
------------------------------- -------------------------------

View File

@ -1937,9 +1937,9 @@ else
c ^= 0x40; c ^= 0x40;
/* Handle \c in an EBCDIC environment. The special case \c? is converted to /* 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 255 (0xff) or 95 (0x5f) if other characters suggest we are using the
encoding. (This is the way Perl indicates that it handles \c?.) The other POSIX-BC encoding. (This is the way Perl indicates that it handles \c?.)
valid sequences correspond to a list of specific characters. */ The other valid sequences correspond to a list of specific characters. */
#else #else
if (c == CHAR_QUESTION_MARK) if (c == CHAR_QUESTION_MARK)
@ -5710,10 +5710,10 @@ for (;; pptr++)
if (range_is_literal && if (range_is_literal &&
(cb->ctypes[c] & ctype_letter) != 0 && (cb->ctypes[c] & ctype_letter) != 0 &&
(cb->ctypes[d] & 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 uc = (d <= CHAR_z)? 0 : 64;
uint32_t C = d - uc; uint32_t C = c - uc;
uint32_t D = d - uc; uint32_t D = d - uc;
if (C <= CHAR_i) if (C <= CHAR_i)