From a848e47ced6e5e2a564b5c454b2f5a19c2f40298 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Thu, 2 Sep 2010 19:22:35 +0300 Subject: xz: Make setting a preset override a custom filter chain. This is more logical behavior than ignoring preset level options once a custom filter chain has been specified. --- src/xz/coder.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/xz/coder.c b/src/xz/coder.c index af49f430..841f63a4 100644 --- a/src/xz/coder.c +++ b/src/xz/coder.c @@ -67,6 +67,15 @@ extern void coder_set_preset(size_t new_preset) { preset_number = new_preset; + + // Setting a preset makes us forget a possibly defined custom + // filter chain. + while (filters_count > 0) { + --filters_count; + free(filters[filters_count].options); + filters[filters_count].options = NULL; + } + return; } -- cgit v1.2.3