summaryrefslogtreecommitdiff
path: root/dev-lang/perl/files/5.42.0/0003-use-5.41-affects-current-line-source-encoding.patch
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2025-11-22 18:00:50 +0000
committerSam James <sam@gentoo.org>2025-11-22 18:01:32 +0000
commitc8c277e982d6f33af441d09c5cacb88d931bdace (patch)
treec36a1d6fdd34e44e9f27de717e5332e0edfe874d /dev-lang/perl/files/5.42.0/0003-use-5.41-affects-current-line-source-encoding.patch
parent71fc6791c36a3873c9c1177c47e549fe3b89c148 (diff)
downloadgentoo-c8c277e982d6f33af441d09c5cacb88d931bdace.tar.gz
gentoo-c8c277e982d6f33af441d09c5cacb88d931bdace.tar.bz2
gentoo-c8c277e982d6f33af441d09c5cacb88d931bdace.zip
dev-lang/perl: backport various fixes to 5.42.0
5.42.1 doesn't seem to be imminent, so backport fixes queued upstream. Bug: https://bugs.gentoo.org/964245 Closes: https://bugs.gentoo.org/964379 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-lang/perl/files/5.42.0/0003-use-5.41-affects-current-line-source-encoding.patch')
-rw-r--r--dev-lang/perl/files/5.42.0/0003-use-5.41-affects-current-line-source-encoding.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/dev-lang/perl/files/5.42.0/0003-use-5.41-affects-current-line-source-encoding.patch b/dev-lang/perl/files/5.42.0/0003-use-5.41-affects-current-line-source-encoding.patch
new file mode 100644
index 000000000000..bfec7d86a213
--- /dev/null
+++ b/dev-lang/perl/files/5.42.0/0003-use-5.41-affects-current-line-source-encoding.patch
@@ -0,0 +1,52 @@
+From 0e0b91d4881226a5532f166662a27ba58f4f718b Mon Sep 17 00:00:00 2001
+Message-ID: <0e0b91d4881226a5532f166662a27ba58f4f718b.1763833678.git.sam@gentoo.org>
+In-Reply-To: <7dbc795b44eb54d41e1c6b30d8796525d65d52b5.1763833678.git.sam@gentoo.org>
+References: <7dbc795b44eb54d41e1c6b30d8796525d65d52b5.1763833678.git.sam@gentoo.org>
+From: Yitzchak Scott-Thoennes <sthoenna@gmail.com>
+Date: Fri, 31 Oct 2025 05:05:33 -0600
+Subject: [PATCH 3/4] 'use 5.41' affects current line source::encoding
+
+Previously it didn't take effect until subsequent lines
+
+Fixes #23881
+
+(cherry picked from commit 5d62050d173f59a343236c6259b5c821d58268d2)
+---
+ lib/source/source_encoding.t | 7 ++++++-
+ op.c | 1 +
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/lib/source/source_encoding.t b/lib/source/source_encoding.t
+index a08489637e..a11b1ca45b 100644
+--- a/lib/source/source_encoding.t
++++ b/lib/source/source_encoding.t
+@@ -44,8 +44,13 @@ if (fresh_perl_like(<<~'EOT',
+ EOT
+ "",
+ { }, "source encoding can be turned off");
++ fresh_perl_like(<<~'EOT',
++ use v5.41.0; my $var = "ΒΆ";
++ EOT
++ qr/Use of non-ASCII character 0x[[:xdigit:]]{2} illegal/,
++ { }, ">= 'use statement affects rest of current line'");
+ }
+-else { # Above test depends on the previous one; if that failed, use this
++else { # Above tests depend on the previous one; if that failed, use this
+ # alternate one
+ fresh_perl_is(<<~'EOT',
+ use source::encoding 'ascii';
+diff --git a/op.c b/op.c
+index 3c316ea8b4..f51eeb3945 100644
+--- a/op.c
++++ b/op.c
+@@ -8341,6 +8341,7 @@ Perl_utilize(pTHX_ int aver, I32 floor, OP *version, OP *idop, OP *arg)
+ else {
+ PL_hints &= ~HINT_ASCII_ENCODING;
+ }
++ notify_parser_that_encoding_changed();
+
+ PL_prevailing_version = shortver;
+ }
+--
+2.52.0
+