diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-08-26 00:34:43 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-08-26 00:34:43 +0200 |
commit | bb8e99fdc367a470c6195a2ae4c33f273fe55a25 (patch) | |
tree | 3b3bcacec8faab66bf6756f20dff1e45462fdc1c /pcre/pcre_compile.c | |
parent | add44e684cb9f1b46d1d5facdf6255360fa7b656 (diff) | |
parent | c02d61bc11ee06b6043e6db9a15d00b9f40bce1f (diff) | |
download | mariadb-git-bb8e99fdc367a470c6195a2ae4c33f273fe55a25.tar.gz |
Merge branch 'bb-10.2-ext' into 10.3
Diffstat (limited to 'pcre/pcre_compile.c')
-rw-r--r-- | pcre/pcre_compile.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/pcre/pcre_compile.c b/pcre/pcre_compile.c index de92313e2f8..42f204cdfff 100644 --- a/pcre/pcre_compile.c +++ b/pcre/pcre_compile.c @@ -5739,6 +5739,21 @@ for (;; ptr++) ptr = p - 1; /* Character before the next significant one. */ } + /* We also need to skip over (?# comments, which are not dependent on + extended mode. */ + + if (ptr[1] == CHAR_LEFT_PARENTHESIS && ptr[2] == CHAR_QUESTION_MARK && + ptr[3] == CHAR_NUMBER_SIGN) + { + ptr += 4; + while (*ptr != CHAR_NULL && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++; + if (*ptr == CHAR_NULL) + { + *errorcodeptr = ERR18; + goto FAILED; + } + } + /* If the next character is '+', we have a possessive quantifier. This implies greediness, whatever the setting of the PCRE_UNGREEDY option. If the next character is '?' this is a minimizing repeat, by default, @@ -8210,7 +8225,6 @@ for (;; ptr++) if (mclength == 1 || req_caseopt == 0) { - firstchar = mcbuffer[0] | req_caseopt; firstchar = mcbuffer[0]; firstcharflags = req_caseopt; |