From: Hugo van der Sanden Date: Mon, 4 Nov 2002 13:23:49 +0000 (+0000) Subject: Re: [perl #17064] illegal legal unicode character X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1d86a7f9aafa7b00ab187ace80f468664c66c924;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #17064] illegal legal unicode character Message-Id: <200211041323.gA4DNn313132@crypt.compulink.co.uk> p4raw-id: //depot/perl@18085 --- diff --git a/regexec.c b/regexec.c index 55cc437..f69c360 100644 --- a/regexec.c +++ b/regexec.c @@ -595,7 +595,7 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos, t = s - prog->check_offset_max; if (s - strpos > prog->check_offset_max /* signed-corrected t > strpos */ - && (!(prog->reganch & ROPT_UTF8) + && (!do_utf8 || ((t = reghopmaybe3_c(s, -(prog->check_offset_max), strpos)) && t > strpos))) /* EMPTY */; @@ -715,7 +715,7 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos, t = s - prog->check_offset_max; if (s - strpos > prog->check_offset_max /* signed-corrected t > strpos */ - && (!(prog->reganch & ROPT_UTF8) + && (!do_utf8 || ((t = reghopmaybe3_c(s, -prog->check_offset_max, strpos)) && t > strpos))) { /* Fixed substring is found far enough so that the match diff --git a/t/op/split.t b/t/op/split.t index db23c90..669ba73 100755 --- a/t/op/split.t +++ b/t/op/split.t @@ -5,7 +5,7 @@ BEGIN { @INC = '../lib'; } -print "1..46\n"; +print "1..47\n"; $FS = ':'; @@ -274,3 +274,16 @@ print "ok 32\n"; $x[2] eq '2'; print "ok 46\n"; } + +{ + # [perl #17064] + my $warn; + local $SIG{__WARN__} = sub { $warn = join '', @_; chomp $warn }; + my $char = "\x{10f1ff}"; + my @a = split /\r?\n/, "$char\n"; + if (@a == 1 && $a[0] eq $char && !defined($warn)) { + print "ok 47\n"; + } else { + print "not ok 47\t# <@a> <$warn>\n"; + } +}