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

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