ghostscript_gpl: bump version, remove ghostscript8 (#8320)

add a ghostscript_gpl9 packagage with libgs.so.9
for compatibility until all packages have been migrated to gs 10.

Also, add the patch for CVE-2023-28879.

ghostscript8: remove
This version was built with gcc11 which wouldn't work with BeOS apps anyway.

BGhostView was already migrated to ghostscript 9.
This commit is contained in:
Joachim Mairböck
2023-04-13 08:38:08 +02:00
committed by GitHub
parent ebc140d983
commit d205d6a4d3
5 changed files with 283 additions and 2891 deletions

View File

@@ -5,11 +5,11 @@ languages. Its main purposes are the rasterization or rendering of such page \
description language files, for the display or printing of document pages, and \
the conversion between PostScript and PDF files."
HOMEPAGE="https://ghostscript.com/"
COPYRIGHT="2001-2021 Artifex Software, Inc."
COPYRIGHT="2001-2022 Artifex Software, Inc."
LICENSE="AGPL-3.0"
REVISION="2"
REVISION="1"
SOURCE_URI="https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${portVersion//./}/ghostscript-$portVersion.tar.xz"
CHECKSUM_SHA256="6ee3057773646d6a2c6d117eb53a17d6752feadc513828e4322f68b7b7789ff6"
CHECKSUM_SHA256="c91193635aa2578f9508b8ba846106c1e3705fbd3fed5fd9a015f21b55f15d68"
SOURCE_DIR="ghostscript-$portVersion"
PATCHES="ghostscript_gpl-$portVersion.patchset"
@@ -22,11 +22,13 @@ if [ "$targetArchitecture" = x86_gcc2 ]; then
commandBinDir=$prefix/bin
fi
libVersion="${portVersion%.*}"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
ghostscript_gpl$secondaryArchSuffix = $portVersion
cmd:dvipdf
cmd:eps2eps
cmd:font2c
cmd:gs
cmd:gsc
cmd:gsbj
@@ -37,24 +39,23 @@ PROVIDES="
cmd:gsnd
cmd:gsx
cmd:lprsetup.sh
cmd:pfbtopfa
cmd:pdf2dsc
cmd:pdf2ps
cmd:pf2afm
cmd:pfbtopfa
cmd:pphs
cmd:printafm
cmd:ps2ascii
cmd:ps2epsi
cmd:ps2pdf
cmd:ps2pdfwr
cmd:ps2pdf12
cmd:ps2pdf13
cmd:ps2pdf14
cmd:ps2pdfwr
cmd:ps2ps
cmd:ps2ps2
cmd:unix_lpr.sh
cmd:wftopfa
lib:libgs$secondaryArchSuffix = 9 compat >= 9
lib:libgs$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
@@ -71,14 +72,14 @@ REQUIRES="
lib:libpaper$secondaryArchSuffix
lib:libpng16$secondaryArchSuffix
lib:libstdc++$secondaryArchSuffix
# lib:libtesseract$secondaryArchSuffix
lib:libtesseract$secondaryArchSuffix
lib:libtiff$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
PROVIDES_devel="
ghostscript_gpl${secondaryArchSuffix}_devel = $portVersion
devel:libgs$secondaryArchSuffix = 9 compat >= 9
devel:libgs$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
@@ -98,7 +99,7 @@ BUILD_REQUIRES="
devel:libopenjp2$secondaryArchSuffix
devel:libpaper$secondaryArchSuffix
devel:libpng16$secondaryArchSuffix
# devel:libtesseract$secondaryArchSuffix
devel:libtesseract$secondaryArchSuffix
devel:libtiff$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
@@ -115,7 +116,7 @@ BUILD_PREREQUIRES="
defineDebugInfoPackage ghostscript_gpl$secondaryArchSuffix \
"$commandBinDir"/gs \
"$libDir"/libgs.so.9
"$libDir"/libgs.so.${libVersion%%.*}
BUILD()
{
@@ -132,9 +133,7 @@ BUILD()
# Force configure to use system-libs
rm -rf {freetype,jbig2dec,jpeg,lcms2mt,libpng,openjpeg,tiff,zlib}
# using system libtesseract is not (yet) supported
#rm -rf {leptonica,tesseract}
rm -rf {leptonica,tesseract}
autoconf

View File

@@ -1,62 +1,26 @@
SUMMARY="An interpreter for the PostScript language and for PDF"
SUMMARY="An interpreter for the PostScript language and for PDF (library only)"
DESCRIPTION="Ghostscript is a suite of software based on an interpreter for \
Adobe Systems' PostScript and Portable Document Format (PDF) page description \
languages. Its main purposes are the rasterization or rendering of such page \
description language files, for the display or printing of document pages, and \
the conversion between PostScript and PDF files."
HOMEPAGE="https://ghostscript.com/"
COPYRIGHT="2001-2018 Artifex Software, Inc."
LICENSE="AFPL"
REVISION="4"
SOURCE_URI="https://sourceforge.net/projects/ghostscript/files/AFPL%20Ghostscript/$portVersion/ghostscript-$portVersion.tar.gz"
CHECKSUM_SHA256="343aaf45cd52539a04ec2172259c8c39b87f613e1a493c74a275350a1ecc6b6a"
SOURCE_DIR="ghostscript-$portVersion"
PATCHES="ghostscript8-$portVersion.patchset"
the conversion between PostScript and PDF files.
ARCHITECTURES="!all ?x86"
This package contains only the libgs library for compatibility purposes."
HOMEPAGE="https://ghostscript.com/"
COPYRIGHT="2001-2021 Artifex Software, Inc."
LICENSE="AGPL-3.0"
REVISION="1"
SOURCE_URI="https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${portVersion//./}/ghostscript-$portVersion.tar.xz"
CHECKSUM_SHA256="6ee3057773646d6a2c6d117eb53a17d6752feadc513828e4322f68b7b7789ff6"
SOURCE_DIR="ghostscript-$portVersion"
PATCHES="ghostscript_gpl-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2 ?x86"
SECONDARY_ARCHITECTURES="x86"
# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandBinDir=$prefix/bin
fi
PROVIDES="
ghostscript8$secondaryArchSuffix = $portVersion
cmd:bdftops
cmd:dvipdf
cmd:eps2eps
cmd:fixmswrd.pl
cmd:font2c
cmd:gs
cmd:gsbe
cmd:gsbj
cmd:gsc
cmd:gsdj
cmd:gsdj500
cmd:gslj
cmd:gslp
cmd:gsnd
cmd:lprsetup.sh
cmd:pfbtopfa
cmd:pdf2dsc
cmd:pdf2ps
cmd:pdfopt
cmd:pf2afm
cmd:printafm
cmd:ps2ascii
cmd:ps2epsi
cmd:ps2pdf
cmd:ps2pdf12
cmd:ps2pdf13
cmd:ps2pdf14
cmd:ps2pdfwr
cmd:ps2ps
cmd:pv.sh
cmd:unix_lpr.sh
cmd:wftopfa
lib:libgs$secondaryArchSuffix = 8.14 compat >= 8
ghostscript_gpl9$secondaryArchSuffix = $portVersion
lib:libgs$secondaryArchSuffix = 9 compat >= 9
"
REQUIRES="
@@ -64,22 +28,27 @@ REQUIRES="
poppler_data
lib:libfontconfig$secondaryArchSuffix
lib:libfreetype$secondaryArchSuffix
lib:libiconv$secondaryArchSuffix
lib:libidn$secondaryArchSuffix
lib:libjbig2dec$secondaryArchSuffix
lib:libjpeg$secondaryArchSuffix
lib:liblcms2$secondaryArchSuffix
lib:libopenjp2$secondaryArchSuffix
lib:libpaper$secondaryArchSuffix
lib:libpng16$secondaryArchSuffix
lib:libstdc++$secondaryArchSuffix
# lib:libtesseract$secondaryArchSuffix
lib:libtiff$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
PROVIDES_devel="
ghostscript8${secondaryArchSuffix}_devel = $portVersion
devel:libgs$secondaryArchSuffix = 8.14 compat >= 8
ghostscript_gpl9${secondaryArchSuffix}_devel = $portVersion
devel:libgs$secondaryArchSuffix = 9 compat >= 9
"
REQUIRES_devel="
ghostscript8$secondaryArchSuffix == $portVersion base
ghostscript_gpl9$secondaryArchSuffix == $portVersion base
"
@@ -87,11 +56,15 @@ BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libfontconfig$secondaryArchSuffix
devel:libfreetype$secondaryArchSuffix
devel:libiconv$secondaryArchSuffix
devel:libidn$secondaryArchSuffix
devel:libjbig2dec$secondaryArchSuffix
devel:libjpeg$secondaryArchSuffix
devel:liblcms2$secondaryArchSuffix
devel:libopenjp2$secondaryArchSuffix
devel:libpaper$secondaryArchSuffix
devel:libpng16$secondaryArchSuffix
# devel:libtesseract$secondaryArchSuffix
devel:libtiff$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
@@ -106,9 +79,8 @@ BUILD_PREREQUIRES="
cmd:sed
"
defineDebugInfoPackage ghostscript8$secondaryArchSuffix \
"$commandBinDir"/gs \
"$libDir"/libgs.so.8.14
defineDebugInfoPackage ghostscript_gpl9$secondaryArchSuffix \
"$libDir"/libgs.so.9
BUILD()
{
@@ -124,26 +96,29 @@ BUILD()
done
# Force configure to use system-libs
rm -rf {freetype,jbig2dec,jpeg,lcms2,libpng,tiff,zlib}
rm -rf {freetype,jbig2dec,jpeg,lcms2mt,libpng,openjpeg,tiff,zlib}
# using system libtesseract is not (yet) supported
#rm -rf {leptonica,tesseract}
autoconf
# Do configure
runConfigure --omit-dirs binDir ./configure \
--bindir=$commandBinDir --with-fontpath="$FONTPATH" EXTRALIBS=-lbe
runConfigure ./configure \
--with-fontpath="$FONTPATH"
# Do make
make
make so
make sodebug $jobArgs
}
INSTALL()
{
make install
make soinstall
make install-sodebug
prepareInstalledDevelLib libgs
packageEntries devel $developDir
# remove binaries
rm -r $binDir
}
TEST()

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,165 @@
From 3e2da1676a7b3a1e9da9c29ada52723e03b37f8a Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sun, 10 Mar 2019 13:45:11 +0100
Subject: Fix build on x86 32bit
Conflict of macro name with a struct field in one of our headers.
diff --git a/psi/estack.h b/psi/estack.h
index 42a5c0a..786787d 100644
--- a/psi/estack.h
+++ b/psi/estack.h
@@ -18,6 +18,8 @@
#ifndef estack_INCLUDED
# define estack_INCLUDED
+#include <signal.h> /* before we #define esp, which prevents it from building */
+
#include "iestack.h"
#include "icstate.h" /* for access to exec_stack */
--
2.37.3
From dbcfce9c0714c80c684b6eda5c1f19b1d4832e76 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Wed, 13 Mar 2019 21:14:28 +0100
Subject: fix building shared libs
diff --git a/configure.ac b/configure.ac
index 68c716b..f2197d9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3066,7 +3066,7 @@ case $host in
GPDL_SONAME_MAJOR="lib\$(GPDL${libname3}"
GPDL_SONAME_MAJOR_MINOR="cyg\$(GPDL${libname2}"
;;
- *bsd*)
+ *bsd*|*haiku*)
DYNAMIC_CFLAGS="-fPIC $DYNAMIC_CFLAGS"
GS_DYNAMIC_LDFLAGS="-shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(GS_SONAME_MAJOR)"
PCL_DYNAMIC_LDFLAGS="-shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(PCL_SONAME_MAJOR)"
--
2.37.3
From 9ebe19b0a8e140d8d8dcbdf00d42c8af237802ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joachim=20Mairb=C3=B6ck?= <j.mairboeck@gmail.com>
Date: Sun, 31 Oct 2021 22:03:15 +0100
Subject: fix looking for dlopen in libdl only
diff --git a/configure.ac b/configure.ac
index f2197d9..cbe25a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -661,8 +661,8 @@ if test "x$ac_cv_header_inttypes_h" = "xyes"; then
GCFLAGS="$GCFLAGS -DHAVE_INTTYPES_H=1"
fi
-AC_CHECK_LIB([dl], [dlopen],
- [AC_CHECK_HEADER([dlfcn.h], [GCFLAGS="$GCFLAGS -DHAVE_LIBDL=1";LIBS="-ldl $LIBS"])]
+AC_SEARCH_LIBS([dlopen], [dl],
+ [AC_CHECK_HEADER([dlfcn.h], [GCFLAGS="$GCFLAGS -DHAVE_LIBDL=1"])]
)
large_color_index=1
--
2.37.3
From 37e790a9a009daead7ff98968bc673881175df8c Mon Sep 17 00:00:00 2001
From: Anarchos <sylvain_kerjean@hotmail.com>
Date: Wed, 2 Mar 2022 21:15:32 +0100
Subject: debug flags for haiku
diff --git a/configure.ac b/configure.ac
index cbe25a1..6f0e98c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -280,7 +280,7 @@ SET_DT_SONAME="-soname="
CFLAGS_LARGEFILE=""
case $host in
- *-linux*|*-gnu)
+ *-linux*|*-gnu|*-haiku)
if test x"$GCC" = x"yes"; then
CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
--
2.37.3
From 9ca5737d3dd79aba9c171121e229c3c601861c43 Mon Sep 17 00:00:00 2001
From: Anarchos <sylvain_kerjean@hotmail.com>
Date: Fri, 4 Mar 2022 05:47:01 +0100
Subject: -g
diff --git a/configure.ac b/configure.ac
index 6f0e98c..68d42e5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -283,7 +283,7 @@ case $host in
*-linux*|*-gnu|*-haiku)
if test x"$GCC" = x"yes"; then
CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
- CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
+ CC_DBG_FLAGS_TO_TRY="-g"
CC_VISIBILITY_FLAGS_TO_TRY="-fvisibility=hidden"
fi
;;
--
2.37.3
From 978e4572d5186fc354aa99258cdeba29f3682ebc Mon Sep 17 00:00:00 2001
From: Anarchos <sylvain_kerjean@hotmail.com>
Date: Thu, 10 Mar 2022 17:11:47 +0100
Subject: debug flags
diff --git a/base/unix-dll.mak b/base/unix-dll.mak
index 89dfa5a..693d9cf 100644
--- a/base/unix-dll.mak
+++ b/base/unix-dll.mak
@@ -431,7 +431,8 @@ soinstall:
$(MAKE) $(SUB_MAKE_OPTION) soinstall-subtarget BUILDDIRPREFIX=$(SODIRPREFIX)
sodebuginstall:
- $(MAKE) $(SUB_MAKE_OPTION) soinstall-subtarget GENOPT='-DDEBUG' BUILDDIRPREFIX=$(SODEBUGDIRPREFIX)
+ GENOPT='-DDEBUG -g'
+ $(MAKE) $(SUB_MAKE_OPTION) soinstall-subtarget GENOPT='$(GENOPT)' BUILDDIRPREFIX=$(SODEBUGDIRPREFIX)
soinstall-subtarget: install-so install-scripts install-data $(INSTALL_SHARED) $(INSTALL_CONTRIB)
--
2.37.3
From c16a0730b6421a2b6dc012655e61df0efdd50135 Mon Sep 17 00:00:00 2001
From: Anarchos <sylvain_kerjean@hotmail.com>
Date: Thu, 10 Mar 2022 21:44:39 +0100
Subject: revert
diff --git a/base/unix-dll.mak b/base/unix-dll.mak
index 693d9cf..89dfa5a 100644
--- a/base/unix-dll.mak
+++ b/base/unix-dll.mak
@@ -431,8 +431,7 @@ soinstall:
$(MAKE) $(SUB_MAKE_OPTION) soinstall-subtarget BUILDDIRPREFIX=$(SODIRPREFIX)
sodebuginstall:
- GENOPT='-DDEBUG -g'
- $(MAKE) $(SUB_MAKE_OPTION) soinstall-subtarget GENOPT='$(GENOPT)' BUILDDIRPREFIX=$(SODEBUGDIRPREFIX)
+ $(MAKE) $(SUB_MAKE_OPTION) soinstall-subtarget GENOPT='-DDEBUG' BUILDDIRPREFIX=$(SODEBUGDIRPREFIX)
soinstall-subtarget: install-so install-scripts install-data $(INSTALL_SHARED) $(INSTALL_CONTRIB)
--
2.37.3

View File

@@ -1,4 +1,4 @@
From 8ab80356e68c1e5f736cabcaeebf8a3fd6cafd33 Mon Sep 17 00:00:00 2001
From 15cf435ad31fd93057f1884fdcf557f2af94c7a8 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sun, 10 Mar 2019 13:45:11 +0100
Subject: Fix build on x86 32bit
@@ -19,10 +19,10 @@ index 42a5c0a..786787d 100644
#include "icstate.h" /* for access to exec_stack */
--
2.30.2
2.37.3
From b09459e2b67a33afd41e2eedc1e0669827ce1d71 Mon Sep 17 00:00:00 2001
From d904d6367b73e55d1ae08cd95bcb3bfcc34ee3d7 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Wed, 13 Mar 2019 21:14:28 +0100
Subject: fix building shared libs
@@ -42,10 +42,10 @@ index 36b51f5..3312477 100644
GS_DYNAMIC_LDFLAGS="-shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(GS_SONAME_MAJOR)"
PCL_DYNAMIC_LDFLAGS="-shared -Wl,\$(LD_SET_DT_SONAME)\$(LDFLAGS_SO_PREFIX)\$(PCL_SONAME_MAJOR)"
--
2.30.2
2.37.3
From 4214bf13e1f71c537d824f99a9a5d57f59f36109 Mon Sep 17 00:00:00 2001
From 172e49fed7566e77853a377495d39e4ab0c08a9a Mon Sep 17 00:00:00 2001
From: Robin Watts <Robin.Watts@artifex.com>
Date: Fri, 1 Oct 2021 12:44:44 +0100
Subject: Bug 704405: Fix typo in non-forked lcms2 code.
@@ -65,10 +65,10 @@ index ccf1d70..9badb6d 100644
int
--
2.30.2
2.37.3
From e0caa4b053c8877375ecce1850f977f81f82571d Mon Sep 17 00:00:00 2001
From cddfe4fd3a9ea86cfc741d756feb56621b570064 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joachim=20Mairb=C3=B6ck?= <j.mairboeck@gmail.com>
Date: Sun, 31 Oct 2021 22:03:15 +0100
Subject: fix looking for dlopen in libdl only
@@ -90,10 +90,10 @@ index 3312477..f627cbf 100644
large_color_index=1
--
2.30.2
2.37.3
From 77e1d546ecdd50d42681611cfe614db60aa6c5ff Mon Sep 17 00:00:00 2001
From 142feac4adcaf527d6e91d146391ffc24647b5cb Mon Sep 17 00:00:00 2001
From: Anarchos <sylvain_kerjean@hotmail.com>
Date: Wed, 2 Mar 2022 21:15:32 +0100
Subject: debug flags for haiku
@@ -113,10 +113,10 @@ index f627cbf..d6563de 100644
CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
--
2.30.2
2.37.3
From 41b392e739aa16d943788b3a889d8a438efd1459 Mon Sep 17 00:00:00 2001
From e95c53554733b0cb22e23d5a2e859d3491c19c62 Mon Sep 17 00:00:00 2001
From: Anarchos <sylvain_kerjean@hotmail.com>
Date: Fri, 4 Mar 2022 05:47:01 +0100
Subject: -g
@@ -136,10 +136,10 @@ index d6563de..d682a97 100644
fi
;;
--
2.30.2
2.37.3
From 8fd422a85278e54141866273a61d3eeb0d2245b1 Mon Sep 17 00:00:00 2001
From 106649b8eac0634fcf494e2271b2b74e050f87a3 Mon Sep 17 00:00:00 2001
From: Anarchos <sylvain_kerjean@hotmail.com>
Date: Thu, 10 Mar 2022 17:11:47 +0100
Subject: debug flags
@@ -160,10 +160,10 @@ index e83390c..3bb6c34 100644
soinstall-subtarget: install-so install-scripts install-data $(INSTALL_SHARED) $(INSTALL_CONTRIB)
--
2.30.2
2.37.3
From 09c8866d8568070e6620599e9faaece0577faf3a Mon Sep 17 00:00:00 2001
From 89994ad54820a468d0065a75076957ef16c836fc Mon Sep 17 00:00:00 2001
From: Anarchos <sylvain_kerjean@hotmail.com>
Date: Thu, 10 Mar 2022 21:44:39 +0100
Subject: revert
@@ -184,5 +184,53 @@ index 3bb6c34..e83390c 100644
soinstall-subtarget: install-so install-scripts install-data $(INSTALL_SHARED) $(INSTALL_CONTRIB)
--
2.30.2
2.37.3
From ca4f3c106f175ec0890661f95b2d59f7ae539bcf Mon Sep 17 00:00:00 2001
From: Ken Sharp <ken.sharp@artifex.com>
Date: Fri, 24 Mar 2023 13:19:57 +0000
Subject: Graphics library - prevent buffer overrun in (T)BCP encoding
Bug #706494 "Buffer Overflow in s_xBCPE_process"
As described in detail in the bug report, if the write buffer is filled
to one byte less than full, and we then try to write an escaped
character, we overrun the buffer because we don't check before
writing two bytes to it.
This just checks if we have two bytes before starting to write an
escaped character and exits if we don't (replacing the consumed byte
of the input).
Up for further discussion; why do we even permit a BCP encoding filter
anyway ? I think we should remove this, at least when SAFER is true.
diff --git a/base/sbcp.c b/base/sbcp.c
index 979ae09..47fc233 100644
--- a/base/sbcp.c
+++ b/base/sbcp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2023 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -50,6 +50,14 @@ s_xBCPE_process(stream_state * st, stream_cursor_read * pr,
byte ch = *++p;
if (ch <= 31 && escaped[ch]) {
+ /* Make sure we have space to store two characters in the write buffer,
+ * if we don't then exit without consuming the input character, we'll process
+ * that on the next time round.
+ */
+ if (pw->limit - q < 2) {
+ p--;
+ break;
+ }
if (p == rlimit) {
p--;
break;
--
2.37.3