From 7c6ab4652943e364cca4cd7bec262deaa0a0902d Mon Sep 17 00:00:00 2001 From: sthen Date: Wed, 7 Apr 2021 09:06:32 +0000 Subject: [PATCH] p5-PDF-API2: add upstream patch, "Fix encoding of \n in string with non-printable chars" --- textproc/p5-PDF-API2/Makefile | 3 +- .../patch-lib_PDF_API2_Basic_PDF_String_pm | 32 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 textproc/p5-PDF-API2/patches/patch-lib_PDF_API2_Basic_PDF_String_pm diff --git a/textproc/p5-PDF-API2/Makefile b/textproc/p5-PDF-API2/Makefile index 4145b4c14e7..920e000c63a 100644 --- a/textproc/p5-PDF-API2/Makefile +++ b/textproc/p5-PDF-API2/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.32 2021/03/06 15:31:12 sthen Exp $ +# $OpenBSD: Makefile,v 1.33 2021/04/07 09:06:32 sthen Exp $ COMMENT = create PDF documents with perl @@ -6,6 +6,7 @@ MODULES = cpan PKG_ARCH = * DISTNAME = PDF-API2-2.039 +REVISION = 0 CATEGORIES = textproc diff --git a/textproc/p5-PDF-API2/patches/patch-lib_PDF_API2_Basic_PDF_String_pm b/textproc/p5-PDF-API2/patches/patch-lib_PDF_API2_Basic_PDF_String_pm new file mode 100644 index 00000000000..a39dd6a748f --- /dev/null +++ b/textproc/p5-PDF-API2/patches/patch-lib_PDF_API2_Basic_PDF_String_pm @@ -0,0 +1,32 @@ +$OpenBSD: patch-lib_PDF_API2_Basic_PDF_String_pm,v 1.1 2021/04/07 09:06:32 sthen Exp $ + +From 3d9787d0c17f7b54af56024a0509f49cd77a54d4 Mon Sep 17 00:00:00 2001 +From: Steve Simms +Date: Tue, 6 Apr 2021 20:09:31 -0400 +Subject: [PATCH] [RT #134957] Fix encoding of \n in string with non-printable + chars + +From c63a96f0ccc79a335801466a0b1e963084dd6e8a Mon Sep 17 00:00:00 2001 +From: Steve Simms +Date: Tue, 6 Apr 2021 20:13:15 -0400 +Subject: [PATCH] Remove unnecessary regex flags + +Index: lib/PDF/API2/Basic/PDF/String.pm +--- lib/PDF/API2/Basic/PDF/String.pm.orig ++++ lib/PDF/API2/Basic/PDF/String.pm +@@ -191,12 +191,12 @@ sub as_pdf { + return ""; + } + else { +- if ($str =~ m/[^\n\r\t\b\f\040-\176\200-\377]/oi) { +- $str =~ s/(.)/sprintf('%02X', ord($1))/oge; ++ if ($str =~ m/[^\n\r\t\b\f\040-\176\200-\377]/) { ++ $str =~ s/(.)/sprintf('%02X', ord($1))/sge; + return "<$str>"; + } + else { +- $str =~ s/([\n\r\t\b\f\\()])/\\$out_trans{$1}/ogi; ++ $str =~ s/([\n\r\t\b\f\\()])/\\$out_trans{$1}/g; + return "($str)"; + } + }