Fix EBCDIC 0x41 omission and give error for \p and \P in a class when not
supported.
This commit is contained in:
parent
78ea22d11d
commit
bac822ba58
10
ChangeLog
10
ChangeLog
|
@ -1,7 +1,7 @@
|
|||
Change Log for PCRE2
|
||||
--------------------
|
||||
|
||||
Version 10.20 16-June-2015
|
||||
Version 10.20 16-June-2015
|
||||
--------------------------
|
||||
|
||||
1. Callouts with string arguments have been added.
|
||||
|
@ -167,6 +167,14 @@ now compatible with the specification in Perl's perlebcdic page.
|
|||
43. Single character repetition in JIT has been improved. 20-30% speedup
|
||||
was achieved on certain patterns.
|
||||
|
||||
44. The EBCDIC character 0x41 is a non-breaking space, equivalent to 0xa0 in
|
||||
ASCII/Unicode. This has now been added to the list of characters that are
|
||||
recognized as white space in EBCDIC.
|
||||
|
||||
45. When PCRE2 was compiled without Unicode support, the use of \p and \P gave
|
||||
an error (correctly) when used outside a class, but did not give an error
|
||||
within a class.
|
||||
|
||||
|
||||
Version 10.10 06-March-2015
|
||||
---------------------------
|
||||
|
|
|
@ -4397,9 +4397,9 @@ for (;; ptr++)
|
|||
cb, PRIV(vspace_list));
|
||||
break;
|
||||
|
||||
#ifdef SUPPORT_UNICODE
|
||||
case ESC_p:
|
||||
case ESC_P:
|
||||
#ifdef SUPPORT_UNICODE
|
||||
{
|
||||
BOOL negated;
|
||||
unsigned int ptype = 0, pdata = 0;
|
||||
|
@ -4413,6 +4413,9 @@ for (;; ptr++)
|
|||
class_has_8bitchar--; /* Undo! */
|
||||
}
|
||||
break;
|
||||
#else
|
||||
*errorcodeptr = ERR45;
|
||||
goto FAILED;
|
||||
#endif
|
||||
/* Unrecognized escapes are faulted. */
|
||||
|
||||
|
|
|
@ -382,7 +382,7 @@ space. However, in many other sources it is listed as a space and has been in
|
|||
PCRE for a long time. */
|
||||
|
||||
#define HSPACE_LIST \
|
||||
CHAR_HT, CHAR_SPACE, 0xa0, \
|
||||
CHAR_HT, CHAR_SPACE, CHAR_NBSP, \
|
||||
0x1680, 0x180e, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, \
|
||||
0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202f, 0x205f, 0x3000, \
|
||||
NOTACHAR
|
||||
|
@ -408,7 +408,7 @@ PCRE for a long time. */
|
|||
#define HSPACE_BYTE_CASES \
|
||||
case CHAR_HT: \
|
||||
case CHAR_SPACE: \
|
||||
case 0xa0 /* NBSP */
|
||||
case CHAR_NBSP
|
||||
|
||||
#define HSPACE_CASES \
|
||||
HSPACE_BYTE_CASES: \
|
||||
|
@ -435,11 +435,12 @@ PCRE for a long time. */
|
|||
/* -------------- EBCDIC environments -------------- */
|
||||
|
||||
#else
|
||||
#define HSPACE_LIST CHAR_HT, CHAR_SPACE
|
||||
#define HSPACE_LIST CHAR_HT, CHAR_SPACE, CHAR_NBSP
|
||||
|
||||
#define HSPACE_BYTE_CASES \
|
||||
case CHAR_HT: \
|
||||
case CHAR_SPACE
|
||||
case CHAR_SPACE: \
|
||||
case CHAR_NBSP
|
||||
|
||||
#define HSPACE_CASES HSPACE_BYTE_CASES
|
||||
|
||||
|
@ -633,6 +634,7 @@ same code point. */
|
|||
|
||||
#define CHAR_ESC '\047'
|
||||
#define CHAR_DEL '\007'
|
||||
#define CHAR_NBSP ((unsigned char)'\x41')
|
||||
#define STR_ESC "\047"
|
||||
#define STR_DEL "\007"
|
||||
|
||||
|
@ -647,6 +649,7 @@ a positive value. */
|
|||
#define CHAR_NEL ((unsigned char)'\x85')
|
||||
#define CHAR_ESC '\033'
|
||||
#define CHAR_DEL '\177'
|
||||
#define CHAR_NBSP ((unsigned char)'\xa0')
|
||||
|
||||
#define STR_LF "\n"
|
||||
#define STR_NL STR_LF
|
||||
|
@ -1029,6 +1032,7 @@ only. */
|
|||
#define CHAR_VERTICAL_LINE '\174'
|
||||
#define CHAR_RIGHT_CURLY_BRACKET '\175'
|
||||
#define CHAR_TILDE '\176'
|
||||
#define CHAR_NBSP ((unsigned char)'\xa0')
|
||||
|
||||
#define STR_HT "\011"
|
||||
#define STR_VT "\013"
|
||||
|
|
|
@ -29,13 +29,16 @@
|
|||
|
||||
/^A\ˆ/
|
||||
A B
|
||||
A\x41B
|
||||
|
||||
# Test \H
|
||||
|
||||
/^A\È/
|
||||
AB
|
||||
A\x42B
|
||||
** Fail
|
||||
A B
|
||||
A\x41B
|
||||
|
||||
# Test \R
|
||||
|
||||
|
|
|
@ -41,16 +41,22 @@ No match
|
|||
/^A\ˆ/
|
||||
A B
|
||||
0: A\x20
|
||||
A\x41B
|
||||
0: AA
|
||||
|
||||
# Test \H
|
||||
|
||||
/^A\È/
|
||||
AB
|
||||
0: AB
|
||||
A\x42B
|
||||
0: AB
|
||||
** Fail
|
||||
No match
|
||||
A B
|
||||
No match
|
||||
A\x41B
|
||||
No match
|
||||
|
||||
# Test \R
|
||||
|
||||
|
|
Loading…
Reference in New Issue