Handle missing Unicode heredoc terminators correctly blead
authorFather Chrysostomos <sprout@cpan.org>
Tue, 26 Jul 2016 17:06:46 +0000 (10:06 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 26 Jul 2016 17:07:17 +0000 (10:07 -0700)
t/lib/croak/toke
toke.c

index cda6ffd..73b02ca 100644 (file)
@@ -70,6 +70,13 @@ Can't find string terminator "foo" anywhere before EOF at (eval 1) line 1.
 EXPECT
 Can't find string terminator "foo" anywhere before EOF at - line 1.
 ########
+# NAME Unterminated here-doc with non-Latin-1 terminator
+BEGIN { binmode STDERR, ":utf8" }
+use utf8;
+<<옷옷
+EXPECT
+Can't find string terminator "옷옷" anywhere before EOF at - line 3.
+########
 # NAME Unterminated qw//
 qw/
 EXPECT
diff --git a/toke.c b/toke.c
index 13d8c3e..19883d6 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -563,6 +563,7 @@ S_missingterm(pTHX_ char *s)
        char * const nl = strrchr(s,'\n');
        if (nl)
            *nl = '\0';
+       uni = UTF;
     }
     else if (PL_multi_close < 32) {
        *tmpbuf = '^';