In
304ee84bde82d4eee33b0d0ff03080b360eae72b I introduced a regression
where floating mandatory strings which were at known offsets started
being treated as though they were allowed "anywhere".
This patch fixes the bug, and adds tests to make sure it does not come
back.
See also discussion in Perl RT #121182.
https://rt.perl.org/Public/Bug/Display.html?id=121182
'D:\\dev/perl/ver/28321_/perl.exe'=>
'/(\\.COM|\\.EXE|\\.BAT|\\.CMD|\\.VBS|\\.VBE|\\.JS|\\.JSE|\\.WSF|\\.WSH|\\.pyo|\\.pyc|\\.pyw|\\.py)$/i',
'q'=>'[q]',
+ "path_sep:\t8490" => '^(\\S{1,9}):\\s*(\\d+)$'
);
while (@tests) {
my ($str,$pat)=splice @tests,0,2;
# that the tests for this result set are finished.
# If you add a test make sure you update $NUM_SECTS
# the commented output is just for legacy/debugging purposes
-BEGIN{ $NUM_SECTS= 6 }
+BEGIN{ $NUM_SECTS= 7 }
__END__
#Compiling REx "X(A|[B]Q||C|D)Y"
1:1[3] 3:4[0]
%MATCHED%
Freeing REx: "[q]"
+---
+#Compiling REx "^(\S{1,9}):\s*(\d+)$"
+#synthetic stclass "ANYOF[\x{00}-\x{08}\x{0E}-\x{1F}\x{21}-\x{FF}][{utf8}0100-167F 1681-1FFF 200B-2027 202A-202E 2030-205E 2060-2FFF 3001-INFINITY]".
+#Final program:
+# 1: BOL (2)
+# 2: OPEN1 (4)
+# 4: CURLY {1,9} (7)
+# 6: NPOSIXD[\s] (0)
+# 7: CLOSE1 (9)
+# 9: EXACT <:> (11)
+# 11: STAR (13)
+# 12: POSIXD[\s] (0)
+# 13: OPEN2 (15)
+# 15: PLUS (17)
+# 16: POSIXD[\d] (0)
+# 17: CLOSE2 (19)
+# 19: EOL (20)
+# 20: END (0)
+#floating ":" at 1..9 (checking floating) stclass ANYOF[\x{00}-\x{08}\x{0E}-\x{1F}\x{21}-\x{FF}][{utf8}0100-167F 1681-1FFF 200B-2027 202A-202E 2030-205E 2060-2FFF 3001-INFINITY] anchored(BOL) minlen 3
+#Freeing REx: "^(\S{1,9}):\s*(\d+)$"
+floating ":" at 1..9 (checking floating) stclass ANYOF[\x{00}-\x{08}\x{0E}-\x{1F}\x{21}-\x{FF}][{utf8}0100-167F 1681-1FFF 200B-2027 202A-202E 2030-205E 2060-2FFF 3001-INFINITY] anchored(BOL) minlen 3
+%MATCHED%
+synthetic stclass
scan = NEXTOPER(scan);
goto do_curly;
}
- is_inf = is_inf_internal = 1;
- scan = regnext(scan);
if (flags & SCF_DO_SUBSTR) {
scan_commit(pRExC_state, data, minlenp, is_inf);
/* Cannot extend fixed substrings */
data->longest = &(data->longest_float);
}
+ is_inf = is_inf_internal = 1;
+ scan = regnext(scan);
goto optimize_curly_tail;
case CURLY:
if (stopparen>0 && (OP(scan)==CURLYN || OP(scan)==CURLYM)