Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbf9d3a5

Browse files
committed
Fix another ancient bug in parsing of BRE-mode regular expressions.
While poking at the regex code, I happened to notice that the bugsquashed in commit afcc8772e had a sibling: next() failed to returna specific value associated with the '}' token for a "\{m,n\}"quantifier when parsing in basic RE mode. Again, this could resultin treating the quantifier as non-greedy, which it never should be inbasic mode. For that to happen, the last character before "\}" thatsets "nextvalue" would have to set it to zero, or it'd have to haveaccidentally been zero from the start. The failure can be provokedrepeatably with, for example, a bound ending in digit "0".Like the previous patch, back-patch all the way.
1 parentd4b667e commitbf9d3a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/regex/regc_lex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ next(struct vars *v)
389389
{
390390
v->now++;
391391
INTOCON(L_BRE);
392-
RET('}');
392+
RETV('}',1);
393393
}
394394
else
395395
FAILW(REG_BADBR);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp