From 4599a1dedd47b916c731b88cf14b8b7a145a28b0 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Mon, 9 Feb 1998 21:47:22 +0200 Subject: [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: API prototype probing Date: Wed, 11 Feb 1998 12:50:35 +0200 (EET) p4raw-id: //depot/perl@504 --- regcomp.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'regcomp.c') 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); } - - - -- cgit v1.2.1