diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-02-05 12:14:43 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-02-05 12:14:43 -0800 |
commit | c52082c6e4811958dd741d67e1178b4e36a09923 (patch) | |
tree | 00c2155f76040b27c1217916ab03df5b8696da6d /src/WrFFrI.c | |
parent | 77e3b389eb92b8d8f94f5b83c1d3d7cd4db5b037 (diff) | |
download | xorg-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/WrFFrI.c')
-rw-r--r-- | src/WrFFrI.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/WrFFrI.c b/src/WrFFrI.c index d59098f..234197a 100644 --- a/src/WrFFrI.c +++ b/src/WrFFrI.c @@ -342,7 +342,11 @@ OpenWriteFile( #ifndef NO_ZPIPE len = strlen(filename); if (len > 2 && !strcmp(".Z", filename + (len - 2))) { +#ifdef XPM_PATH_COMPRESS mdata->stream.file = xpmPipeThrough(fd, XPM_PATH_COMPRESS, NULL, "w"); +#else + mdata->stream.file = NULL; +#endif mdata->type = XPMPIPE; } else if (len > 3 && !strcmp(".gz", filename + (len - 3))) { mdata->stream.file = xpmPipeThrough(fd, XPM_PATH_GZIP, "-q", "w"); |