aboutsummaryrefslogtreecommitdiff
path: root/src/lzma
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-10-07 09:40:31 +0300
committerLasse Collin <lasse.collin@tukaani.org>2008-10-07 09:40:31 +0300
commit1e8e4fd1f3e50129b4541406ad765d2aa1233943 (patch)
treec2c952fb207b48effd8585436d3c83c7a475a22d /src/lzma
parentRemoved fi from po/LINGUAS. (diff)
downloadxz-1e8e4fd1f3e50129b4541406ad765d2aa1233943.tar.xz
Made the preset numbering more logical in liblzma API.
Diffstat (limited to '')
-rw-r--r--src/lzma/args.c8
-rw-r--r--src/lzma/args.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/lzma/args.c b/src/lzma/args.c
index 47ae766a..14ccfb6d 100644
--- a/src/lzma/args.c
+++ b/src/lzma/args.c
@@ -40,13 +40,13 @@ bool opt_keep_original = false;
bool opt_preserve_name = false;
lzma_check opt_check = LZMA_CHECK_CRC64;
-lzma_filter opt_filters[8];
+lzma_filter opt_filters[LZMA_BLOCK_FILTERS_MAX + 1];
// We don't modify or free() this, but we need to assign it in some
// non-const pointers.
const char *stdin_filename = "(stdin)";
-static size_t preset_number = 7 - 1;
+static size_t preset_number = 7;
static bool preset_default = true;
static size_t filter_count = 0;
@@ -178,7 +178,7 @@ parse_real(int argc, char **argv)
case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
- preset_number = c - '1';
+ preset_number = c - '0';
preset_default = false;
break;
@@ -502,7 +502,7 @@ set_compression_settings(void)
// setting is used.
if (preset_default) {
while (memory_usage > opt_memory) {
- if (preset_number == 0) {
+ if (preset_number == 1) {
errmsg(V_ERROR, _("Memory usage limit is too "
"small for any internal "
"filter preset"));
diff --git a/src/lzma/args.h b/src/lzma/args.h
index 587b280f..8d9cd306 100644
--- a/src/lzma/args.h
+++ b/src/lzma/args.h
@@ -55,7 +55,7 @@ extern enum tool_mode opt_mode;
extern enum format_type opt_format;
extern lzma_check opt_check;
-extern lzma_filter opt_filters[8];
+extern lzma_filter opt_filters[LZMA_BLOCK_FILTERS_MAX + 1];
extern const char *stdin_filename;