Loading src/mkhelp.pl +17 −11 Original line number Diff line number Diff line Loading @@ -120,6 +120,7 @@ HEAD ; if($c) { print <<HEAD #include <stdlib.h> #include <zlib.h> static const unsigned char hugehelpgz[] = { /* This mumbo-jumbo is the huge help text compressed with gzip. Loading @@ -144,10 +145,11 @@ HEAD print "\n};\n"; print <<EOF #define BUF_SIZE 0x10000 /* Decompress and send to stdout a gzip-compressed buffer */ void hugehelp(void) { unsigned char buf[0x10000]; unsigned char* buf; int status,headerlen; z_stream z; Loading @@ -165,18 +167,22 @@ void hugehelp(void) if (inflateInit2(&z, -MAX_WBITS) != Z_OK) return; buf = malloc(BUF_SIZE); if (buf) { while(1) { z.avail_out = (int)sizeof(buf); z.avail_out = BUF_SIZE; z.next_out = buf; status = inflate(&z, Z_SYNC_FLUSH); if (status == Z_OK || status == Z_STREAM_END) { fwrite(buf, sizeof(buf) - z.avail_out, 1, stdout); fwrite(buf, BUF_SIZE - z.avail_out, 1, stdout); if (status == Z_STREAM_END) break; } else break; /* Error */ } free(buf); } inflateEnd(&z); } EOF Loading Loading
src/mkhelp.pl +17 −11 Original line number Diff line number Diff line Loading @@ -120,6 +120,7 @@ HEAD ; if($c) { print <<HEAD #include <stdlib.h> #include <zlib.h> static const unsigned char hugehelpgz[] = { /* This mumbo-jumbo is the huge help text compressed with gzip. Loading @@ -144,10 +145,11 @@ HEAD print "\n};\n"; print <<EOF #define BUF_SIZE 0x10000 /* Decompress and send to stdout a gzip-compressed buffer */ void hugehelp(void) { unsigned char buf[0x10000]; unsigned char* buf; int status,headerlen; z_stream z; Loading @@ -165,18 +167,22 @@ void hugehelp(void) if (inflateInit2(&z, -MAX_WBITS) != Z_OK) return; buf = malloc(BUF_SIZE); if (buf) { while(1) { z.avail_out = (int)sizeof(buf); z.avail_out = BUF_SIZE; z.next_out = buf; status = inflate(&z, Z_SYNC_FLUSH); if (status == Z_OK || status == Z_STREAM_END) { fwrite(buf, sizeof(buf) - z.avail_out, 1, stdout); fwrite(buf, BUF_SIZE - z.avail_out, 1, stdout); if (status == Z_STREAM_END) break; } else break; /* Error */ } free(buf); } inflateEnd(&z); } EOF Loading