diff options
author | Werner Koch <wk@gnupg.org> | 2014-01-09 19:05:07 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2014-01-09 19:51:35 +0100 |
commit | 00d5d2204cefb0f4b953e0c00448f16aab2d39c7 (patch) | |
tree | 7712be53988f9a9453167862bbce368ff0a94376 /tools | |
parent | w32: Fix backslash quoting in registry name. (diff) | |
download | gnupg2-00d5d2204cefb0f4b953e0c00448f16aab2d39c7.tar.xz gnupg2-00d5d2204cefb0f4b953e0c00448f16aab2d39c7.zip |
gpgsplit: Allow building without zlib support.
* tools/gpgsplit.c [!HAVE_ZLIB]: Do not include zlib.h.
(handle_zlib): Build only if HAVE_ZLIB is defined.
(write_part): Support zlib and zip only if HAVE_ZLIB is defined.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/gpgsplit.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tools/gpgsplit.c b/tools/gpgsplit.c index 928e283e5..78e87aa15 100644 --- a/tools/gpgsplit.c +++ b/tools/gpgsplit.c @@ -29,9 +29,11 @@ #ifdef HAVE_DOSISH_SYSTEM # include <fcntl.h> /* for setmode() */ #endif -#include <zlib.h> +#ifdef HAVE_ZIP +# include <zlib.h> +#endif #ifdef HAVE_BZIP2 -#include <bzlib.h> +# include <bzlib.h> #endif /* HAVE_BZIP2 */ #if defined(__riscos__) && defined(USE_ZLIBRISCOS) # include "zlib-riscos.h" @@ -360,6 +362,7 @@ public_key_length (const unsigned char *buf, size_t buflen) return s - buf; } +#ifdef HAVE_ZIP static int handle_zlib(int algo,FILE *fpin,FILE *fpout) { @@ -452,6 +455,7 @@ handle_zlib(int algo,FILE *fpin,FILE *fpout) return 0; } +#endif /*HAVE_ZIP*/ #ifdef HAVE_BZIP2 static int @@ -698,11 +702,15 @@ write_part (FILE *fpin, unsigned long pktlen, if ((c = getc (fpin)) == EOF) goto read_error; - if(c==1 || c==2) + if (0) + ; +#ifdef HAVE_ZIP + else if(c==1 || c==2) { if(handle_zlib(c,fpin,fpout)) goto write_error; } +#endif /* HAVE_ZIP */ #ifdef HAVE_BZIP2 else if(c==3) { |