mirror of
https://github.com/janet-lang/janet
synced 2025-10-30 15:13:03 +00:00
Address #640.
Allow for a zero length match at the end of a string when using the to or thru combinators.
This commit is contained in:
@@ -286,7 +286,7 @@ tail:
|
||||
const uint8_t *next_text;
|
||||
CapState cs = cap_save(s);
|
||||
down1(s);
|
||||
while (text < s->text_end) {
|
||||
while (text <= s->text_end) {
|
||||
CapState cs2 = cap_save(s);
|
||||
next_text = peg_rule(s, rule_a, text);
|
||||
if (next_text) {
|
||||
@@ -296,7 +296,7 @@ tail:
|
||||
text++;
|
||||
}
|
||||
up1(s);
|
||||
if (text >= s->text_end) {
|
||||
if (text > s->text_end) {
|
||||
cap_load(s, cs);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user