summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-02-14 01:00:15 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-02-14 01:00:15 +0000
commit9e67d94e6e4396a78a2012441f9359240f5b4bdd (patch)
treefc1c6466e151f0e066a87df256b70d1b8cc35a91 /regcomp.c
parent9d8a25dc64d23dcd5730db9be0dbe94a107e1f8b (diff)
parentb17fe6e572cf341e620c89fc18fb670ef7f916a6 (diff)
downloadperl-9e67d94e6e4396a78a2012441f9359240f5b4bdd.tar.gz
[asperl] bring ASPerl uptodate with mainline changes
p4raw-id: //depot/asperl@524
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 b457cfb2f2..363a14bca8 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -1846,6 +1846,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) {
@@ -2642,6 +2666,3 @@ re_croak2(const char* pat1,const char* pat2, va_alist)
buf[l1] = '\0'; /* Overwrite \n */
croak("%s", buf);
}
-
-
-