From 000dfd2d23e52925b97fdb70c3a45e996df1ff2e Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Sat, 15 Mar 2014 14:27:47 +0000 Subject: re_intuit_start(): fix byte/char calculation err On failure to find stclass in float range, it currently does: rx_origin = check_at - start_shift; which should instead be rx_origin = HOP3c(check_at, - start_shift, strbeg); The second added test is an example of when this causes a false negative. (The first test is just the analogue without a UTF8 string, so it already passes). Since we actually already calculate this value earlier as part of determining endpos in the float case, assign the result of that calc to a local var, then just reuse it. --- t/re/re_tests | 2 ++ 1 file changed, 2 insertions(+) (limited to 't/re/re_tests') diff --git a/t/re/re_tests b/t/re/re_tests index 3bb0ae5011..7ab7dc34fc 100644 --- a/t/re/re_tests +++ b/t/re/re_tests @@ -1881,6 +1881,8 @@ A+(*PRUNE)BC(?{}) AAABC y $& AAABC /(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\13\14/ abcdefghijk\12\13\14 y $& abcdefghijk\12\13\14 \d<(.*?)> a<> n - - +[bcd].{2,3}aaaa XbXaaaaa y - - +[bcd].{2,3}aaaa Xb\x{100}aaaaa y - - # Keep these lines at the end of the file # vim: softtabstop=0 noexpandtab -- cgit v1.2.1