By storing whether or not a block has been opened (or terminated), the
static trees used for the block and the end block markers can be emitted
appropriately.
s->block_start = s->strstart;
flush_pending(s->strm);
+ s->block_open = 0;
}
static inline Pos quick_insert_string(deflate_state *const s, const Pos str) {
IPos hash_head;
unsigned dist, match_len;
- if (s->strm->total_out == 2) {
+ if (s->block_open == 0) {
static_emit_tree(s, flush);
+ s->block_open = 1;
}
do {
* longest match routines access bytes past the input. This is then
* updated to the new high water mark.
*/
+ int block_open;
+ /* Whether or not a block is currently open for the QUICK deflation scheme.
+ * This is set to 1 if there is an active block, or 0 if the block was just
+ * closed.
+ */
+
} deflate_state;
typedef enum {