summaryrefslogtreecommitdiff
path: root/src/RdFToI.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-02-05 12:14:43 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-02-05 12:14:43 -0800
commitc52082c6e4811958dd741d67e1178b4e36a09923 (patch)
tree00c2155f76040b27c1217916ab03df5b8696da6d /src/RdFToI.c
parent77e3b389eb92b8d8f94f5b83c1d3d7cd4db5b037 (diff)
downloadxorg-lib-libXpm-c52082c6e4811958dd741d67e1178b4e36a09923.tar.gz
open-zfile: Make compress & uncompress commands optional
If compress is not found, we disable writing to .Z files, but leave the rest of the compression code active. If uncompress is not found, we use gzip to read .Z files. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/RdFToI.c')
-rw-r--r--src/RdFToI.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/RdFToI.c b/src/RdFToI.c
index 141c485..a16af88 100644
--- a/src/RdFToI.c
+++ b/src/RdFToI.c
@@ -246,7 +246,11 @@ OpenReadFile(
if ( ext && !strcmp(ext, ".Z") )
{
mdata->type = XPMPIPE;
+#ifdef XPM_PATH_UNCOMPRESS
mdata->stream.file = xpmPipeThrough(fd, XPM_PATH_UNCOMPRESS, "-c", "r");
+#else
+ mdata->stream.file = xpmPipeThrough(fd, XPM_PATH_GZIP, "-dqc", "r");
+#endif
}
else if ( ext && !strcmp(ext, ".gz") )
{