summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.org>2002-11-04 13:23:49 +0000
committerhv <hv@crypt.org>2002-11-04 12:17:12 +0000
commit1d86a7f9aafa7b00ab187ace80f468664c66c924 (patch)
treef3bbc656a4ffc8d58807a3ea2658290d3c51511e
parent532eb83898dc393c9f89b475b9f77385c39eff97 (diff)
downloadperl-1d86a7f9aafa7b00ab187ace80f468664c66c924.tar.gz
Re: [perl #17064] illegal legal unicode character
Message-Id: <200211041323.gA4DNn313132@crypt.compulink.co.uk> p4raw-id: //depot/perl@18085
-rw-r--r--regexec.c4
-rwxr-xr-xt/op/split.t15
2 files changed, 16 insertions, 3 deletions
diff --git a/regexec.c b/regexec.c
index 55cc43769b..f69c36002c 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 db23c9073c..669ba7360e 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";
+ }
+}