Blame SOURCES/0006-Use-gzip-d-instead-of-gunzip.patch

a4ac63
From 8b52b950360cd7224f504f294997f3a9d7e18b91 Mon Sep 17 00:00:00 2001
a4ac63
From: Peter Hutterer <peter.hutterer@who-t.net>
a4ac63
Date: Mon, 16 Jan 2023 19:44:52 +1000
a4ac63
Subject: [PATCH libXpm] Use gzip -d instead of gunzip
a4ac63
a4ac63
GNU gunzip [1] is a shell script that exec's `gzip -d`. Even if we call
a4ac63
/usr/bin/gunzip with the correct built-in path, the actual gzip call
a4ac63
will use whichever gzip it finds first, making our patch pointless.
a4ac63
a4ac63
Fix this by explicitly calling gzip -d instead.
a4ac63
a4ac63
https://git.savannah.gnu.org/cgit/gzip.git/tree/gunzip.in
a4ac63
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
a4ac63
---
a4ac63
 README       | 2 +-
a4ac63
 configure.ac | 3 +--
a4ac63
 src/RdFToI.c | 2 +-
a4ac63
 3 files changed, 3 insertions(+), 4 deletions(-)
a4ac63
a4ac63
diff --git a/README b/README
a4ac63
index c7d6dbf..d4c7212 100644
a4ac63
--- a/README
a4ac63
+++ b/README
a4ac63
@@ -48,5 +48,5 @@ the first version found in the PATH used to run configure, and do not depend
a4ac63
 on the PATH environment variable set at runtime.
a4ac63
 
a4ac63
 To specify paths to be used for these commands instead of searching $PATH, pass
a4ac63
-the XPM_PATH_COMPRESS, XPM_PATH_UNCOMPRESS, XPM_PATH_GZIP, and XPM_PATH_GUNZIP
a4ac63
+the XPM_PATH_COMPRESS, XPM_PATH_UNCOMPRESS, and XPM_PATH_GZIP
a4ac63
 variables to the configure command.
a4ac63
diff --git a/configure.ac b/configure.ac
a4ac63
index c1da348..74d9856 100644
a4ac63
--- a/configure.ac
a4ac63
+++ b/configure.ac
a4ac63
@@ -57,7 +57,7 @@ AC_DEFINE_UNQUOTED([$1], ["$$1"], [Path to $2])
a4ac63
 ]) dnl End of AC_DEFUN([XPM_PATH_PROG]...
a4ac63
 
a4ac63
 # Optional feature: When a filename ending in .Z or .gz is requested,
a4ac63
-# open a pipe to a newly forked compress/uncompress/gzip/gunzip command to
a4ac63
+# open a pipe to a newly forked compress/uncompress/gzip command to
a4ac63
 # handle it.
a4ac63
 AC_MSG_CHECKING([whether to handle compressed pixmaps])
a4ac63
 case $host_os in
a4ac63
@@ -75,7 +75,6 @@ else
a4ac63
         XPM_PATH_PROG([XPM_PATH_COMPRESS], [compress])
a4ac63
         XPM_PATH_PROG([XPM_PATH_UNCOMPRESS], [uncompress])
a4ac63
         XPM_PATH_PROG([XPM_PATH_GZIP], [gzip])
a4ac63
-        XPM_PATH_PROG([XPM_PATH_GUNZIP], [gunzip])
a4ac63
         AC_CHECK_FUNCS([closefrom close_range], [break])
a4ac63
 fi
a4ac63
 
a4ac63
diff --git a/src/RdFToI.c b/src/RdFToI.c
a4ac63
index a91d337..141c485 100644
a4ac63
--- a/src/RdFToI.c
a4ac63
+++ b/src/RdFToI.c
a4ac63
@@ -251,7 +251,7 @@ OpenReadFile(
a4ac63
 	else if ( ext && !strcmp(ext, ".gz") )
a4ac63
 	{
a4ac63
 	    mdata->type = XPMPIPE;
a4ac63
-	    mdata->stream.file = xpmPipeThrough(fd, XPM_PATH_GUNZIP, "-qc", "r");
a4ac63
+	    mdata->stream.file = xpmPipeThrough(fd, XPM_PATH_GZIP, "-dqc", "r");
a4ac63
 	}
a4ac63
 	else
a4ac63
 #endif /* z-files */
a4ac63
-- 
a4ac63
2.39.0
a4ac63