Fix deparsing of transliterations with unprintable characters

This commit is contained in:
Petr Písař 2018-01-09 15:46:05 +01:00
parent 304000db79
commit 1a6038ddc1
2 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,48 @@
From abd17348111a99642da217c45d836f2df5713594 Mon Sep 17 00:00:00 2001
From: John Lightsey <lightsey@debian.org>
Date: Tue, 31 Oct 2017 18:12:26 -0500
Subject: [PATCH] Fix deparsing of transliterations with unprintable
characters.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RT #132405
Signed-off-by: Nicolas R <atoomic@cpan.org>
Petr Písař: Port to 5.26.1.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
lib/B/Deparse.pm | 2 +-
lib/B/Deparse.t | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/lib/B/Deparse.pm b/lib/B/Deparse.pm
index 3166415..cc74552 100644
--- a/lib/B/Deparse.pm
+++ b/lib/B/Deparse.pm
@@ -5200,7 +5200,7 @@ sub pchr { # ASCII
} elsif ($n == ord "\r") {
return '\\r';
} elsif ($n >= ord("\cA") and $n <= ord("\cZ")) {
- return '\\c' . unctrl{chr $n};
+ return '\\c' . $unctrl{chr $n};
} else {
# return '\x' . sprintf("%02x", $n);
return '\\' . sprintf("%03o", $n);
diff --git a/lib/B/Deparse.t b/lib/B/Deparse.t
index 7eeb4f8..eae9c49 100644
--- a/lib/B/Deparse.t
+++ b/lib/B/Deparse.t
@@ -2610,3 +2610,8 @@ sub ($a, $=) {
$a;
}
;
+####
+# tr with unprintable characters
+my $str;
+$str = 'foo';
+$str =~ tr/\cA//;
--
2.13.6

View File

@ -225,6 +225,10 @@ Patch66: perl-5.26.1-perl-131895-fail-stat-on-names-with-0-embedded.patch
# Fix a crash when untying an object witout a stash, in upstream after 5.27.5
Patch67: perl-5.27.5-Avoid-a-segfault-when-untying-an-object.patch
# Fix deparsing of transliterations with unprintable characters, RT#132405,
# in upstream after 5.27.5
Patch68: perl-5.26.1-Fix-deparsing-of-transliterations-with-unprintable-c.patch
# Link XS modules to libperl.so with EU::CBuilder on Linux, bug #960048
Patch200: perl-5.16.3-Link-XS-modules-to-libperl.so-with-EU-CBuilder-on-Li.patch
@ -2807,6 +2811,7 @@ Perl extension for Version Objects
%patch65 -p1
%patch66 -p1
%patch67 -p1
%patch68 -p1
%patch200 -p1
%patch201 -p1
@ -2848,6 +2853,7 @@ perl -x patchlevel.h \
'Fedora Patch65: Fix walking symbol table for ISA in Carp' \
'Fedora Patch66: Fix handling file names with null bytes in stat and lstat functions (RT#131895)' \
'Fedora Patch67: Fix a crash when untying an object witout a stash' \
'Fedora Patch68: Fix deparsing of transliterations with unprintable characters (RT#132405)' \
'Fedora Patch200: Link XS modules to libperl.so with EU::CBuilder on Linux' \
'Fedora Patch201: Link XS modules to libperl.so with EU::MM on Linux' \
%{nil}
@ -5142,6 +5148,7 @@ popd
- Fix handling file names with null bytes in stat and lstat functions
(RT#131895)
- Fix a crash when untying an object witout a stash
- Fix deparsing of transliterations with unprintable characters (RT#132405)
* Mon Sep 25 2017 Jitka Plesnikova <jplesnik@redhat.com> - 4:5.26.1-401
- Update perl(:MODULE_COMPAT)