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

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