Back out change that treated "refuse options = compress" the same as
"dont compress = *", by request of Tridge. Instead, mention the difference
in the man page. Also, put in a shortcut in set_compression() to recognize
"*" earlier instead of going through malloc/strtok/fnmatch/free cycle.
diff --git a/token.c b/token.c
index 3bd8d34..2967b44 100644
--- a/token.c
+++ b/token.c
@@ -21,7 +21,6 @@
#include "zlib/zlib.h"
extern int do_compression;
-int default_compression_level = Z_DEFAULT_COMPRESSION;
static int compression_level = Z_DEFAULT_COMPRESSION;
/* determine the compression level based on a wildcard filename list */
@@ -33,11 +32,17 @@
if (!do_compression) return;
- compression_level = default_compression_level;
+ compression_level = Z_DEFAULT_COMPRESSION;
dont = lp_dont_compress(module_id);
if (!dont || !*dont) return;
+ if ((dont[0] == '*') && (!dont[1])) {
+ /* an optimization to skip the rest of this routine */
+ compression_level = 0;
+ return;
+ }
+
dont = strdup(dont);
fname = strdup(fname);
if (!dont || !fname) return;