summaryrefslogtreecommitdiff
path: root/yarp/regexp.c
diff options
context:
space:
mode:
authorJemma Issroff <[email protected]>2023-06-30 14:30:24 -0400
committerJemma Issroff <[email protected]>2023-07-05 16:58:55 -0400
commitbfb933371d80f5a4ba23f2e978050e33c74de80e (patch)
tree406227a26e0a47c7c192e5e456610fdde422a498 /yarp/regexp.c
parent6f9d1b4b0f8938c42aa767577c7c6761ed9de64a (diff)
Manual YARP resync
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/8007
Diffstat (limited to 'yarp/regexp.c')
-rw-r--r--yarp/regexp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/yarp/regexp.c b/yarp/regexp.c
index 1d4d1ac1af..c8aeaa0adb 100644
--- a/yarp/regexp.c
+++ b/yarp/regexp.c
@@ -374,7 +374,7 @@ yp_regexp_parse_group(yp_regexp_parser_t *parser) {
case '#': { // inline comments
bool found = yp_regexp_char_find(parser, ')');
// the close paren we found is escaped, we need to find another
- while (parser->start <= parser->cursor - 2 && *(parser->cursor - 2) == '\\') {
+ while (found && (parser->start <= parser->cursor - 2) && (*(parser->cursor - 2) == '\\')) {
found = yp_regexp_char_find(parser, ')');
}
return found;