This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix skipping char in (*sr:...) defn
authorKarl Williamson <khw@cpan.org>
Tue, 20 Feb 2018 03:28:19 +0000 (20:28 -0700)
committerKarl Williamson <khw@cpan.org>
Tue, 20 Feb 2018 03:47:10 +0000 (20:47 -0700)
This was wrongly calling nextchar(), which skipped the next character
wrongly

regcomp.c
t/re/script_run.t

index 8f55141..13c4154 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -10899,7 +10899,6 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
 
                     if (RExC_in_script_run) {
                         paren = ':';
 
                     if (RExC_in_script_run) {
                         paren = ':';
-                        nextchar(pRExC_state);
                         ret = NULL;
                         goto parse_rest;
                     }
                         ret = NULL;
                         goto parse_rest;
                     }
index 6779e2e..5005d63 100644 (file)
@@ -86,4 +86,7 @@ foreach my $type ('script_run', 'sr') {
     like("写真だけの結婚式", $script_run, "Mixed Hiragana and Han");
 }
 
     like("写真だけの結婚式", $script_run, "Mixed Hiragana and Han");
 }
 
+    # Until fixed, this was skipping the '['
+    unlike("abc]c", qr/^ (*sr:a(*sr:[bc]*)c) $/x, "Doesn't skip parts of exact matches");
+
 done_testing();
 done_testing();