projects
/
debian
/
gzip
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
maint: update copyright year ranges to include 2015; update gnulib
[debian/gzip]
/
deflate.c
diff --git
a/deflate.c
b/deflate.c
index c4a764867a3151848cc2849bbdbe4ad666c7d6c8..ecf02c3bf5643af35c943fb4684c521515662c5c 100644
(file)
--- a/
deflate.c
+++ b/
deflate.c
@@
-1,6
+1,6
@@
/* deflate.c -- compress data using the deflation algorithm
/* deflate.c -- compress data using the deflation algorithm
- Copyright (C) 1999, 2006, 2009-201
1
Free Software Foundation, Inc.
+ Copyright (C) 1999, 2006, 2009-201
5
Free Software Foundation, Inc.
Copyright (C) 1992-1993 Jean-loup Gailly
This program is free software; you can redistribute it and/or modify
Copyright (C) 1992-1993 Jean-loup Gailly
This program is free software; you can redistribute it and/or modify
@@
-209,7
+209,7
@@
local unsigned int max_lazy_match;
local int compr_level;
/* compression level (1..9) */
local int compr_level;
/* compression level (1..9) */
-
static
unsigned good_match;
+unsigned good_match;
/* Use a faster search when the previous match is longer than this */
/* Use a faster search when the previous match is longer than this */
@@
-226,10
+226,17
@@
typedef struct config {
ush max_chain;
} config;
ush max_chain;
} config;
+#ifdef ASMV
+# define static_unless_ASMV
+#else
+# define static_unless_ASMV static
+#endif
+
#ifdef FULL_SEARCH
# define nice_match MAX_MATCH
#else
#ifdef FULL_SEARCH
# define nice_match MAX_MATCH
#else
- static int nice_match; /* Stop searching when current match exceeds this */
+ /* Stop searching when current match exceeds this */
+ static_unless_ASMV int nice_match;
#endif
local config configuration_table[10] = {
#endif
local config configuration_table[10] = {
@@
-300,7
+307,7
@@
void lm_init (pack_level, flags)
compr_level = pack_level;
/* Initialize the hash table. */
compr_level = pack_level;
/* Initialize the hash table. */
-#if defined
(MAXSEG_64K)
&& HASH_BITS == 15
+#if defined
MAXSEG_64K
&& HASH_BITS == 15
for (j = 0; j < HASH_SIZE; j++) head[j] = NIL;
#else
memzero((char*)head, HASH_SIZE*sizeof(*head));
for (j = 0; j < HASH_SIZE; j++) head[j] = NIL;
#else
memzero((char*)head, HASH_SIZE*sizeof(*head));
@@
-407,7
+414,7
@@
longest_match(IPos cur_match)
/* Skip to next match if the match length cannot increase
* or if the match length is less than 2:
*/
/* Skip to next match if the match length cannot increase
* or if the match length is less than 2:
*/
-#if
(defined(UNALIGNED_OK) && MAX_MATCH == 258)
+#if
defined UNALIGNED_OK && MAX_MATCH == 258
/* This code assumes sizeof(unsigned short) == 2. Do not use
* UNALIGNED_OK if your compiler uses a different size.
*/
/* This code assumes sizeof(unsigned short) == 2. Do not use
* UNALIGNED_OK if your compiler uses a different size.
*/
@@
-564,6
+571,8
@@
local void fill_window()
n = read_buf((char*)window+strstart+lookahead, more);
if (n == 0 || n == (unsigned)EOF) {
eofile = 1;
n = read_buf((char*)window+strstart+lookahead, more);
if (n == 0 || n == (unsigned)EOF) {
eofile = 1;
+ /* Don't let garbage pollute the dictionary. */
+ memzero (window + strstart + lookahead, MIN_MATCH - 1);
} else {
lookahead += n;
}
} else {
lookahead += n;
}