summaryrefslogtreecommitdiff
path: root/pcredemo.c
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2009-09-11 10:21:02 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2009-09-11 10:21:02 +0000
commitce9acaefd260bb9b3285c97b80f966f8be08983e (patch)
treeb06cff980512a020f5455bc0debb57557a6cd044 /pcredemo.c
parent4f7977841d1bab49257fed652dbd05a90a503f84 (diff)
downloadpcre-ce9acaefd260bb9b3285c97b80f966f8be08983e.tar.gz
Added PCRE_NOTEMPTY_ATSTART to fix /g bug when \K is present.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@442 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcredemo.c')
-rw-r--r--pcredemo.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/pcredemo.c b/pcredemo.c
index 3647568..c6ba56e 100644
--- a/pcredemo.c
+++ b/pcredemo.c
@@ -223,12 +223,12 @@ if (namecount <= 0) printf("No named substrings\n"); else
* *
* If the previous match WAS for an empty string, we can't do that, as it *
* would lead to an infinite loop. Instead, a special call of pcre_exec() *
-* is made with the PCRE_NOTEMPTY and PCRE_ANCHORED flags set. The first *
-* of these tells PCRE that an empty string is not a valid match; other *
-* possibilities must be tried. The second flag restricts PCRE to one *
-* match attempt at the initial string position. If this match succeeds, *
-* an alternative to the empty string match has been found, and we can *
-* proceed round the loop. *
+* is made with the PCRE_NOTEMPTY_ATSTART and PCRE_ANCHORED flags set. *
+* The first of these tells PCRE that an empty string at the start of the *
+* subject is not a valid match; other possibilities must be tried. The *
+* second flag restricts PCRE to one match attempt at the initial string *
+* position. If this match succeeds, an alternative to the empty string *
+* match has been found, and we can proceed round the loop. *
*************************************************************************/
if (!find_all)
@@ -251,7 +251,7 @@ for (;;)
if (ovector[0] == ovector[1])
{
if (ovector[0] == subject_length) break;
- options = PCRE_NOTEMPTY | PCRE_ANCHORED;
+ options = PCRE_NOTEMPTY_ATSTART | PCRE_ANCHORED;
}
/* Run the next matching operation */