summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1998-02-09 21:47:22 +0200
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1998-02-12 16:22:46 +0000
commit4599a1dedd47b916c731b88cf14b8b7a145a28b0 (patch)
tree4a726863ff896ab939e8e21a3d0e4a9a0af0003d /regcomp.c
parent0018b59d6c770680881f484bcbc39fc8d4a15036 (diff)
downloadperl-4599a1dedd47b916c731b88cf14b8b7a145a28b0.tar.gz
[PATCH] 5.004_58: the locale.t problem in IRIX
Date: Mon, 9 Feb 1998 19:47:22 +0200 (EET) Subject: [PATCH] 5.004_58: reserve the POSIX regexp extensions Date: Tue, 10 Feb 1998 15:12:12 +0200 (EET) Subject: [PATCH] 5.004_58: <netdb.h> API prototype probing Date: Wed, 11 Feb 1998 12:50:35 +0200 (EET) p4raw-id: //depot/perl@504
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/regcomp.c b/regcomp.c
index aa713bc0a5..a42c4db0a4 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -1866,6 +1866,30 @@ regclass(void)
while (regparse < regxend && *regparse != ']') {
skipcond:
Class = UCHARAT(regparse++);
+ if (Class == '[' && regparse + 1 < regxend &&
+ /* I smell either [: or [= or [. -- POSIX has been here, right? */
+ (*regparse == ':' || *regparse == '=' || *regparse == '.')) {
+ char posixccc = *regparse;
+ char* posixccs = regparse++;
+
+ while (regparse < regxend && *regparse != posixccc)
+ regparse++;
+ if (regparse == regxend)
+ /* Grandfather lone [:, [=, [. */
+ regparse = posixccs;
+ else {
+ regparse++; /* skip over the posixccc */
+ if (*regparse == ']') {
+ /* Not Implemented Yet.
+ * (POSIX Extended Character Classes, that is)
+ * The text between e.g. [: and :] would start
+ * at posixccs + 1 and stop at regparse - 2. */
+ if (dowarn && !SIZE_ONLY)
+ warn("Character class syntax [%c %c] is reserved for future extensions", posixccc, posixccc);
+ regparse++; /* skip over the ending ] */
+ }
+ }
+ }
if (Class == '\\') {
Class = UCHARAT(regparse++);
switch (Class) {
@@ -2662,6 +2686,3 @@ re_croak2(const char* pat1,const char* pat2, va_alist)
buf[l1] = '\0'; /* Overwrite \n */
croak("%s", buf);
}
-
-
-