From: Nick Ing-Simmons Date: Fri, 8 Aug 2003 20:36:56 +0000 (+0100) Subject: UNICODE regexp bug X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c1e0e3d213c8ff11e0eeef6aecef3894e8ec6e96;p=p5sagit%2Fp5-mst-13.2.git UNICODE regexp bug Message-Id: <20030808193656.5109.1@llama.ni-s.u-net.com> p4raw-id: //depot/perl@20566 --- diff --git a/regexec.c b/regexec.c index 1127933..d4cf4ed 100644 --- a/regexec.c +++ b/regexec.c @@ -1034,7 +1034,9 @@ S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *sta c1 = *(U8*)m; c2 = PL_fold_locale[c1]; do_exactf: - e = HOP3c(strend, -(I32)ln, s); + /* The last byte to try is ln-1 characters before strend + * since the strend points one byte past the string. */ + e = HOP3c(strend, (I32)1 - (I32)ln, s); if (norun && e < s) e = s; /* Due to minlen logic of intuit() */ diff --git a/t/op/pat.t b/t/op/pat.t index d606a6a..b106c75 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -6,7 +6,7 @@ $| = 1; -print "1..1008\n"; +print "1..1009\n"; BEGIN { chdir 't' if -d 't'; @@ -3196,4 +3196,7 @@ ok("abcde" eq "$`", '# TODO #19049 - global match not setting $`'); ok("123\x{100}" =~ /^.*1.*23\x{100}$/, 'uft8 + multiple floating substr'); +ok(" \x{101}" =~ qr/\x{100}/i, + "<20030808193656.5109.1@llama.ni-s.u-net.com>"); + # last test 1008