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

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