aboutsummaryrefslogtreecommitdiff
path: root/src/xz (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-06-18xz: Use lzma_cputhreads() instead of own copy of tuklib_cpucores().Lasse Collin2-4/+9
2014-06-18xz: Check for filter chain compatibility for --flush-timeout.Lasse Collin1-9/+21
This avoids LZMA_PROG_ERROR from lzma_code() with filter chains that don't support LZMA_SYNC_FLUSH.
2014-06-09xz: Force single-threaded mode when --flush-timeout is used.Lasse Collin1-0/+11
2014-05-08xz: Fix uint64_t vs. size_t which broke 32-bit build.Lasse Collin1-1/+1
Thanks to Christian Hesse.
2014-04-09xz: Rename a variable to avoid a namespace collision on Solaris.Lasse Collin1-5/+7
I don't know the details but I have an impression that there's no problem in practice if using GCC since people have built xz with GCC (without patching xz), but renaming the variable cannot hurt either. Thanks to Mark Ashley.
2014-01-12xz: Fix a comment.Lasse Collin1-2/+2
2014-01-12xz: Fix use of wrong variable.Lasse Collin1-1/+1
Since the only call to suffix_set() uses optarg as the argument, fixing this bug doesn't change the behavior of the program.
2013-11-12xz: Update the man page about --block-size and --block-list.Lasse Collin1-9/+15
2013-11-12xz: Make --block-list and --block-size work together in single-threaded.Lasse Collin1-15/+75
Previously, --block-list and --block-size only worked together in threaded mode. Boundaries are specified by --block-list, but --block-size specifies the maximum size for a Block. Now this works in single-threaded mode too. Thanks to James M Leddy for the original patch.
2013-10-25xz: Document behavior of --block-list with threads.Lasse Collin1-3/+21
This needs to be updated before 5.2.0.
2013-10-22xz: Document --flush-timeout=TIMEOUT on the man page.Lasse Collin1-1/+36
2013-10-22xz: Take advantage of LZMA_FULL_BARRIER with --block-list.Lasse Collin1-17/+15
Now if --block-list is used in threaded mode, the encoder won't need to flush at each Block boundary specified via --block-list. This improves performance a lot, making threading helpful with --block-list. The flush timer was reset after LZMA_FULL_FLUSH but since LZMA_FULL_BARRIER doesn't flush, resetting the timer is no longer done.
2013-09-17xz: Add a missing test for TUKLIB_DOSLIKE.Lasse Collin1-0/+2
2013-09-17Add native threading support on Windows.Lasse Collin1-4/+4
Now liblzma only uses "mythread" functions and types which are defined in mythread.h matching the desired threading method. Before Windows Vista, there is no direct equivalent to pthread condition variables. Since this package doesn't use pthread_cond_broadcast(), pre-Vista threading can still be kept quite simple. The pre-Vista code doesn't use anything that wasn't already available in Windows 95, so the binaries should run even on Windows 95 if someone happens to care.
2013-07-04xz: Add preliminary support for --flush-timeout=TIMEOUT.Lasse Collin3-21/+78
When --flush-timeout=TIMEOUT is used, xz will use LZMA_SYNC_FLUSH if read() would block and at least TIMEOUT milliseconds has elapsed since the previous flush. This can be useful in realtime-like use cases where the data is simultanously decompressed by another process (possibly on a different computer). If new uncompressed input data is produced slowly, without this option xz could buffer the data for a long time until it would become decompressible from the output. If TIMEOUT is 0, the feature is disabled. This is the default. This commit affects the compression side. Using xz for the decompression side for the above purpose doesn't work yet so well because there is quite a bit of input and output buffering when decompressing. The --long-help or man page were not updated yet. The details of this feature may change.
2013-07-04xz: Don't set src_eof=true after an I/O error because it's useless.Lasse Collin1-3/+0
2013-07-04xz: Fix the test when to read more input.Lasse Collin1-3/+3
Testing for end of file was no longer correct after full flushing became possible with --block-size=SIZE and --block-list=SIZES. There was no bug in practice though because xz just made a few unneeded zero-byte reads.
2013-07-04xz: Move some of the timing code into mytime.[hc].Lasse Collin6-40/+158
This switches units from microseconds to milliseconds. New clock_gettime(CLOCK_MONOTONIC) will be used if available. There is still a fallback to gettimeofday().
2013-07-01xz: Silence a warning seen with _FORTIFY_SOURCE=2.Lasse Collin1-1/+7
Thanks to Christian Hesse.
2013-06-29xz: Use non-blocking I/O for the output file.Lasse Collin1-8/+49
Now both reading and writing should be without race conditions with signals. They might still be signal handling issues left. Signals are blocked during many operations to avoid EINTR but it may cause problems e.g. if writing to stderr blocks when trying to display an error message.
2013-06-28xz: Fix return value type in io_write_buf().Lasse Collin1-1/+1
It didn't affect the behavior of the code since -1 becomes true anyway.
2013-06-28xz: Use the self-pipe trick to avoid a race condition with signals.Lasse Collin3-12/+57
It is possible that a signal to set user_abort arrives right before a blocking system call is made. In this case the call may block until another signal arrives, while the wanted behavior is to make xz clean up and exit as soon as possible. After this commit, the race condition is avoided with the input side which already uses non-blocking I/O. The output side still uses blocking I/O and thus has the race condition.
2013-06-28xz: Use non-blocking I/O for the input file.Lasse Collin1-45/+111
2013-06-28xz: Remove an outdated NetBSD-specific comment.Lasse Collin1-4/+0
Nowadays errno == EFTYPE is documented in open(2).
2013-06-28xz: Fix error detection of fcntl(fd, F_SETFL, flags) calls.Lasse Collin1-4/+4
POSIX says that fcntl(fd, F_SETFL, flags) returns -1 on error and "other than -1" on success. This is how it is documented e.g. on OpenBSD too. On Linux, success with F_SETFL is always 0 (at least accorinding to fcntl(2) from man-pages 3.51).
2013-06-28xz: Fix use of wrong variable in a fcntl() call.Lasse Collin1-11/+13
Due to a wrong variable name, when writing a sparse file to standard output, *all* file status flags were cleared (to the extent the operating system allowed it) instead of only clearing the O_APPEND flag. In practice this worked fine in the common situations on GNU/Linux, but I didn't check how it behaved elsewhere. The original flags were still restored correctly. I still changed the code to use a separate boolean variable to indicate when the flags should be restored instead of relying on a special value in stdout_flags.
2013-06-28xz: Fix assertion related to posix_fadvise().Lasse Collin1-8/+2
Input file can be a FIFO or something else that doesn't support posix_fadvise() so don't check the return value even with an assertion. Nothing bad happens if the call to posix_fadvise() fails.
2013-06-26xz: Check the value of lzma_stream_flags.version in --list.Lasse Collin1-0/+14
It is a no-op for now, but if an old xz version is used together with a newer liblzma that supports something new, then this check becomes important and will stop the old xz from trying to parse files that it won't understand.
2013-06-23xz: Validate Uncompressed Size from Block Header in list.c.Lasse Collin1-1/+13
This affects only "xz -lvv". Normal decompression with xz already detected if Block Header and Index had mismatched Uncompressed Size fields. So this just makes "xz -lvv" show such files as corrupt instead of showing the Uncompressed Size from Index.
2013-06-21xz: Make the man page more friendly to doclifter.Lasse Collin1-3/+4
Thanks to Eric S. Raymond.
2013-06-21xz: A couple of man page fixes.Lasse Collin1-12/+23
Now the interaction of presets and custom filter chains is described correctly. Earlier it contradicted itself. Thanks to DevHC who reported these issues on IRC to me on 2012-12-14.
2013-06-21xz: Fix interaction between preset and custom filter chains.Lasse Collin1-14/+21
There was somewhat illogical behavior when --extreme was specified and mixed with custom filter chains. Before this commit, "xz -9 --lzma2 -e" was equivalent to "xz --lzma2". After it is equivalent to "xz -6e" (all earlier preset options get forgotten when a custom filter chain is specified and the default preset is 6 to which -e is applied). I find this less illogical. This also affects the meaning of "xz -9e --lzma2 -7". Earlier it was equivalent to "xz -7e" (the -e specified before a custom filter chain wasn't forgotten). Now it is "xz -7". Note that "xz -7e" still is the same as "xz -e7". Hopefully very few cared about this in the first place, so pretty much no one should even notice this change. Thanks to Conley Moorhous.
2012-12-14Make the progress indicator smooth in threaded mode.Lasse Collin1-7/+13
This adds lzma_get_progress() to liblzma and takes advantage of it in xz. lzma_get_progress() collects progress information from the thread-specific structures so that fairly accurate progress information is available to applications. Adding a new function seemed to be a better way than making the information directly available in lzma_stream (like total_in and total_out are) because collecting the information requires locking mutexes. It's waste of time to do it more often than the up to date information is actually needed by an application.
2012-12-13xz: Mention --threads in --help.Lasse Collin1-0/+4
Thanks to Olivier Delhomme for pointing out that this was still missing.
2012-10-03xz: Fix the note about --rsyncable on the man page.Lasse Collin1-8/+9
2012-09-28xz: Improve handling of failed realloc in xrealloc.Lasse Collin1-2/+12
Thanks to Jim Meyering.
2012-08-24A few typo fixes to comments and the xz man page.Lasse Collin1-2/+2
Thanks to Jim Meyering.
2012-08-13xz: Add a warning to --help about alpha and beta versions.Lasse Collin1-0/+5
2012-07-04xz: Document --block-list better.Lasse Collin1-1/+7
Thanks to Jonathan Nieder.
2012-07-04xz: Fix the version number printed by xz -lvv.Lasse Collin1-3/+3
The decoder bug was fixed in 5.0.2 instead of 5.0.3.
2012-07-03xz: Add incomplete support for --block-list.Lasse Collin7-10/+151
It's broken with threads and when also --block-size is used.
2012-07-01xz: Update the man page about the new field in --robot -lvv.Lasse Collin1-1/+17
2012-06-22xz: Update man page date to match the latest update.Lasse Collin1-1/+1
2012-05-28xz: Don't show a huge number in -vv when memory limit is disabled.Lasse Collin1-1/+11
2012-05-27xz: Document the "summary" lines of --robot -lvv.Lasse Collin1-0/+19
This documents only the columns that are in v5.0. The new columns added in the master branch aren't necessarily stable yet.
2012-05-27xz: Fix output of verbose --robot --list modes.Lasse Collin1-1/+1
It printed the filename in "filename (x/y)" format which it obviously shouldn't do in robot mode.
2011-11-07xz: Show minimum required XZ Utils version in xz -lvv.Lasse Collin1-6/+57
Man page wasn't updated yet.
2011-11-04xz: Fix a typo in a comment.Lasse Collin1-1/+1
Thanks to Bela Lubkin.
2011-11-03xz: Fix xz on EBCDIC systems.Lasse Collin1-1/+4
Thanks to Chris Donawa.
2011-05-27xz: Fix error handling in xz -lvv.Lasse Collin1-15/+6
It could do an invalid free() and read past the end of the uninitialized filters array.
2011-05-21xz: Translate also the string used to print the program name.Lasse Collin1-1/+5
French needs a space before a colon, e.g. "xz : foo error".
2011-05-17Add underscores to attributes (__attribute((__foo__))).Lasse Collin7-19/+19
2011-05-01xz: Fix input file position when --single-stream is used.Lasse Collin3-0/+29
Now the following works as you would expect: echo foo | xz > foo.xz echo bar | xz >> foo.xz ( xz -dc --single-stream ; xz -dc --single-stream ) < foo.xz Note that it doesn't work if the input is not seekable or if there is Stream Padding between the concatenated .xz Streams.
2011-05-01xz: Print the maximum number of worker threads in xz -vv.Lasse Collin1-0/+4
2011-04-12Put the unstable APIs behind #ifdef LZMA_UNSTABLE.Lasse Collin1-0/+2
This way people hopefully won't complain if these APIs change and break code that used an older API.
2011-04-12Remove doubled words from documentation and comments.Lasse Collin2-2/+2
Spot candidates by running these commands: git ls-files |xargs perl -0777 -n \ -e 'while (/\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt]o)\s+\1\b/gims)' \ -e '{$n=($` =~ tr/\n/\n/ + 1); ($v=$&)=~s/\n/\\n/g; print "$ARGV:$n:$v\n"}' Thanks to Jim Meyering for the original patch.
2011-04-12xz: Update the man page about threading.Lasse Collin1-14/+20
2011-04-11xz: Add support for threaded compression.Lasse Collin2-80/+125
2011-04-11xz: Move the description of --block-size in --long-help.Lasse Collin1-4/+4
2011-04-11Docs: Document --single-stream and --block-size.Lasse Collin1-2/+36
2011-04-10xz/DOS: Add experimental 8.3 filename support.Lasse Collin1-9/+167
This is incompatible with the 8.3 support patch made by Juan Manuel Guerrero. I think this one is nicer, but I need to get feedback from DOS users before saying that this is the final version of 8.3 filename support.
2011-04-10xz/DOS: Be more careful with the destination file.Lasse Collin1-2/+33
Try to avoid overwriting the source file if --force is used and the generated destination filename refers to the source file. This can happen with 8.3 filenames where extra characters are ignored. If the generated output file refers to a special file like "con" or "prn", refuse to write to it even if --force is used.
2011-04-09xz: Avoid unneeded fstat() on DOS-like systems.Lasse Collin1-6/+8
2011-04-09xz: Minor internal changes to handling of --threads.Lasse Collin3-19/+18
Now it always defaults to one thread. Maybe this will change again if a threading method is added that doesn't affect memory usage.
2011-04-08xz: Change size_t to uint32_t in a few places.Lasse Collin2-4/+4
2011-04-08xz: Fix a typo in a comment.Lasse Collin1-1/+1
2011-04-05xz: Use posix_fadvise() if it is available.Lasse Collin1-0/+15
2011-04-05xz: Call lzma_end(&strm) before exiting if debugging is enabled.Lasse Collin3-0/+19
2011-03-18xz: Add --block-size=SIZE.Lasse Collin4-10/+54
This uses LZMA_FULL_FLUSH every SIZE bytes of input. Man page wasn't updated yet.
2011-03-18xz: Add --single-stream.Lasse Collin4-3/+23
This can be useful when there is garbage after the compressed stream (.xz, .lzma, or raw stream). Man page wasn't updated yet.
2011-02-06xz: Clean up suffix.c.Lasse Collin1-24/+20
struct suffix_pair isn't needed in compresed_name() so get rid of it there.
2011-02-06xz: Check if the file already has custom suffix when compressing.Lasse Collin1-0/+9
Now "xz -S .test foo.test" refuses to compress the file because it already has the suffix .test. The man page had it documented this way already.
2011-01-26xz: Fix --force on setuid/setgid/sticky and multi-hardlink files.Lasse Collin1-8/+7
xz didn't compress setuid/setgid/sticky files and files with multiple hard links even with --force. This bug was introduced in 23ac2c44c3ac76994825adb7f9a8f719f78b5ee4. Thanks to Charles Wilson.
2011-01-18Add alloc_size and malloc attributes to a few functions.Lasse Collin1-2/+3
Thanks to Cristian Rodríguez for the original patch.
2010-12-12DOS-like: Treat \ and : as directory separators in addition to /.Lasse Collin1-4/+29
Juan Manuel Guerrero had fixed this in his XZ Utils port to DOS/DJGPP. The bug affects also Windows and OS/2.
2010-10-21xz: Make sure that message_strm() can never return NULL.Lasse Collin1-2/+5
2010-10-19Clean up a few FIXMEs and TODOs.Lasse Collin1-1/+1
lzma_chunk_size() was commented out because it is currently useless.
2010-10-12xz: Avoid raise() also on OpenVMS.Lasse Collin1-1/+1
This is similar to DOS/DJGPP that killing the program with a signal will print a backtrace or a similar message.
2010-10-11xz: Avoid SA_RESTART for portability reasons.Lasse Collin3-23/+25
SA_RESTART is not as portable as I had hoped. It's missing at least from OpenVMS, QNX, and DJGPP). Luckily we can do fine without SA_RESTART.
2010-10-10xz: Use "%"PRIu32 instead of "%d" in a format string.Lasse Collin1-1/+1
2010-10-09OS/2 and DOS: Be less verbose on signals.Lasse Collin1-0/+7
Calling raise() to kill xz when user has pressed C-c is a bit verbose on OS/2 and DOS/DJGPP. Instead of calling raise(), set only the exit status to 1.
2010-10-08Build: Add options to disable individual command line tools.Lasse Collin1-1/+5
2010-10-05Build: Remove the static/dynamic tricks.Lasse Collin1-3/+1
Most distros want xz linked against shared liblzma, so it doesn't help much to require --enable-dynamic for that. Those who want to avoid PIC on x86-32 to get better performance, can still do it e.g. by using --disable-shared to compile xz and then another pass to compile shared liblzma. Part of these static/dynamic tricks were needed for Windows in the past. Nowadays we rely on GCC and binutils to do the right thing with auto-import. If the Autotooled build system needs to support some other toolchain on Windows in the future, this may need some rethinking.
2010-10-04A few more languages files to the xz man page.Lasse Collin1-21/+24
Thanks to Jonathan Nieder.
2010-09-28Fix accomodate -> accommodate on the xz man page.Lasse Collin1-1/+1
2010-09-27Major man page updates.Lasse Collin1-598/+1366
Lots of content was updated on the xz man page. Technical improvements: - Start a new sentence on a new line. - Use fairly short lines. - Use constant-width font for examples (where supported). - Some minor cleanups. Thanks to Jonathan Nieder for some language fixes.
2010-09-15xz: Edit a translators comment.Lasse Collin1-1/+1
2010-09-10xz: Add a comment to translators about "literal context bits".Lasse Collin1-0/+4
2010-09-10xz: Multiple fixes.Lasse Collin7-187/+232
The code assumed that printing numbers with thousand separators and decimal points would always produce only US-ASCII characters. This was used for buffer sizes (with snprintf(), no overflows) and aligning columns of the progress indicator and --list. That assumption was wrong (e.g. LC_ALL=fi_FI.UTF-8 with glibc), so multibyte character support was added in this commit. The old way is used if the operating system doesn't have enough multibyte support (e.g. lacks wcwidth()). The sizes of buffers were increased to accomodate multibyte characters. I don't know how big they should be exactly, but they aren't used for anything critical, so it's not too bad. If they still aren't big enough, I hopefully get a bug report. snprintf() takes care of avoiding buffer overflows. Some static buffers were replaced with buffers allocated on stack. double_to_str() was removed. uint64_to_str() and uint64_to_nicestr() now share the static buffer and test for thousand separator support. Integrity check names "None" and "Unknown-N" (2 <= N <= 15) were marked to be translated. I had forgot these, plus they wouldn't have worked correctly anyway before this commit, because printing tables with multibyte strings didn't work. Thanks to Marek Černocký for reporting the bug about misaligned table columns in --list output.
2010-09-07xz: Add a note to translators.Lasse Collin1-0/+2
2010-09-07Fix use of N_() and ngettext().Lasse Collin1-2/+2
I had somehow thought that N_() is usually used as shorthand for ngettext(). This also fixes a missing \n from a call to ngettext().
2010-09-06xz: Improve a comment.Lasse Collin1-3/+4
2010-09-05xz: Update the comment about NetBSD in file_io.c.Lasse Collin1-4/+4
Thanks to Joerg Sonnenberger.
2010-09-05xz: Use an array instead of pointer for stdin_filename.Lasse Collin2-2/+2
Thanks Joerg Sonnenberger.
2010-09-05xz: Hopefully ease translating the messages in list.c.Lasse Collin1-10/+23
2010-09-04xz: Fix grammar.Lasse Collin1-2/+1
2010-09-04xz: Use lzma_lzma_preset() to initialize the options structure.Lasse Collin1-12/+2
2010-09-04xz: Minor improvements to --help and --long-help.Lasse Collin1-12/+12
2010-09-03xz: Make -vv show also decompressor memory usage.Lasse Collin1-0/+7
2010-09-03xz: Make --help two lines shorter.Lasse Collin1-2/+5
At least for now, the --help option doesn't list any options that take arguments, so "Mandatory arguments to..." can be omitted.
2010-09-02xz: Make setting a preset override a custom filter chain.Lasse Collin1-0/+9
This is more logical behavior than ignoring preset level options once a custom filter chain has been specified.
2010-09-02xz: Always warn if adjusting dictionary size due to memlimit.Lasse Collin1-19/+9
2010-08-07Disable the memory usage limiter by default.Lasse Collin8-235/+365
For several people, the limiter causes bigger problems that it solves, so it is better to have it disabled by default. Those who want to have a limiter by default need to enable it via the environment variable XZ_DEFAULTS. Support for environment variable XZ_DEFAULTS was added. It is parsed before XZ_OPT and technically identical with it. The intended uses differ quite a bit though; see the man page. The memory usage limit can now be set separately for compression and decompression using --memlimit-compress and --memlimit-decompress. To set both at once, -M or --memlimit can be used. --memory was retained as a legacy alias for --memlimit for backwards compatibility. The semantics of --info-memory were changed in backwards incompatible way. Compatibility wasn't meaningful due to changes in the memory usage limiter functionality. The memory usage limiter info is no longer shown at the bottom of xz --long -help. The memory usage limiter support for removed completely from xzdec. xz's man page was updated to match the above changes. Various unrelated fixes were also made to the man page.
2010-08-06Add missing const to a global constant in xz.Lasse Collin2-2/+2
2010-07-28Language fixes for man pages.Lasse Collin1-3/+3
Thanks to A. Costa and Jonathan Nieder.
2010-06-15Add --no-adjust.Lasse Collin5-9/+28
2010-06-11Clarify the description of the default memlimit in the man page.Lasse Collin1-2/+2
Thanks to Denis Excoffier.
2010-06-11Fix string to uint64_t conversion.Lasse Collin1-2/+8
Thanks to Denis Excoffier for the bug report.
2010-06-02Fix compiling with -Werror.Lasse Collin1-2/+2
2010-06-02Fix a Windows-specific FIXME in signal handling code.Lasse Collin3-13/+48
2010-06-02Adjust SA_RESTART workaround.Lasse Collin1-7/+7
I want to get a bug report if something else than DJGPP lacks SA_RESTART.
2010-06-01xz man page updates.Lasse Collin1-19/+366
- Concatenating .xz files and padding - List mode - Robot mode - A few examples (but many more are needed)
2010-06-01Major update to xz --list.Lasse Collin1-181/+471
2010-06-01Rename message_filters_get() to message_filters_to_str().Lasse Collin2-3/+3
2010-05-27Take Cygwin into account in some #if lines.Lasse Collin2-3/+3
This change is no-op, but good to have just in case for the future.
2010-05-27Remove references to the Subblock filter in xz and tests.Lasse Collin1-9/+0
Thanks to Jonathan Nieder.
2010-05-27Use my_min() instead of MIN() in src/xz/list.cJonathan Nieder1-1/+1
This should have been done in 920a69a8d8e4203c5edddd829d932130eac188ea.
2010-05-26Rename MIN() and MAX() to my_min() and my_max().Lasse Collin1-1/+2
This should avoid some minor portability issues.
2010-05-26Remove the Subblock filter code for now.Lasse Collin3-76/+1
The spec isn't finished and the code didn't compile anymore. It won't be included in XZ Utils 5.0.0. It's easy to get it back once the spec is done.
2010-05-16Split message_filters().Lasse Collin3-69/+134
message_filters_to_str() converts the filter chain to a string. message_filters_show() replaces the original message_filters(). uint32_to_optstr() was also added to show the dictionary size in nicer format when possible.
2010-04-12Show both elapsed time and estimated remaining time in xz -v.Lasse Collin1-48/+38
The extra space for showing both has been taken from the sizes field. If the sizes grow big, bigger units than MiB will be used. It makes it slightly difficult to see that progress is still happening with huge files, but it should be OK in practice. Thanks to Trent W. Buck for <http://bugs.debian.org/574583> and Jonathan Nieder for suggestions how to fix it.
2010-03-07Treat all integer multiplier suffixes as base-2.Lasse Collin2-50/+51
Originally both base-2 and base-10 were supported, but since there seems to be little need for base-10 in XZ Utils, treat everything as base-2 and also be more relaxed about the case of the first letter of the suffix. Now xz will accept e.g. KiB, Ki, k, K, kB, and KB, and interpret them all as 1024. The recommended spelling of the suffixes are still KiB, MiB, and GiB.
2010-03-07Consistently round up the memory usage limit in messages.Lasse Collin1-2/+3
It still feels a bit wrong to round 1 byte to 1 MiB but at least it is now done consistently so that the same byte value is always rounded the same way to MiB.
2010-03-07Increase the default memory usage limit on "low-memory" systems.Lasse Collin2-18/+46
Previously the default limit was always 40 % of RAM. The new limit is a little bit more complex: - If 40 % of RAM is at least 80 MiB, 40 % of RAM is used as the limit. - If 80 % of RAM is over 80 MiB, 80 MiB is used as the limit. - Otherwise 80 % of RAM is used as the limit. This should make it possible to decompress files created with "xz -9" on more systems. Swapping is generally more expected on systems with less RAM, so higher default limit on them shouldn't cause too bad surprises in terms of heavy swapping. Instead, the higher default limit should reduce the number of bad surprises when it used to prevent decompression of files created with "xz -9". The DoS prevention system shouldn't be a DoS itself. Note that even with the new default limit, a system with 64 MiB RAM cannot decompress files created with "xz -9" without user overriding the limit. This should be OK, because if xz is going to need more memory than the system has RAM, it will run very very slowly and thus it's good that user has to override the limit in that case.
2010-02-12Collection of language fixes to comments and docs.Lasse Collin7-20/+20
Thanks to Jonathan Nieder.
2010-02-02Fix wrong assertion.Lasse Collin1-2/+3
This was added in 455e68c030fde8a8c2f5e254c3b3ab9489bf3735.
2010-02-01Fix typos in comments.Lasse Collin1-1/+1
2010-02-01Fix signal handling for --list.Lasse Collin1-5/+14
2010-02-01Fix compression of symlinks with --force.Lasse Collin1-1/+13
xz --force accepted symlinks, but didn't remove them after successful compression. Instead, an error message was displayed.
2010-01-31Select the default integrity check type at runtime.Lasse Collin1-5/+14
Previously it was set statically to CRC64 or CRC32 depending on options passed to the configure script.
2010-01-31Improve displaying of the memory usage limit.Lasse Collin4-13/+45
2010-01-31Don't use uninitialized sigset_t.Lasse Collin1-10/+24
If signal handlers haven't been established, then it's useless to try to block them, especially since the sigset_t used for blocking hasn't been initialized yet.
2010-01-31Delay opening the destionation file and other fixes.Lasse Collin6-125/+157
The opening of the destination file is now delayed a little. The coder is initialized, and if decompressing, the memory usage of the first Block compared against the memory usage limit before the destination file is opened. This means that if --force was used, the old "target" file won't be deleted so easily when something goes wrong very early. Thanks to Mark K for the bug report. The above fix required some changes to progress message handling. Now there is a separate function for setting and printing the filename. It is used also in list.c. list_file() now handles stdin correctly (gives an error). A useless check for user_abort was removed from file_io.c.
2010-01-29Add list.h to src/xz/Makefile.am.Lasse Collin1-0/+1
This should have been already in 0bc9eab243dee3be764b3530433a7fcdc3f7c6a1.
2010-01-27Silence two compiler warnings on DOS-like systems.Lasse Collin1-0/+3
2010-01-27Use PACKAGE_URL instead of custom PACKAGE_HOMEPAGE.Lasse Collin1-1/+1
2010-01-26Add a missing space to an error message.Lasse Collin1-1/+1
Thanks to Robert Readman.
2010-01-26Use past tense in error message in io_unlink().Lasse Collin1-2/+12
Added a note to translators too. Thanks to Robert Readman.
2010-01-26Fix too small static buffer in util.c.Lasse Collin1-5/+4
This was introduced in 0dd6d007669b946543ca939a44243833c79e08f4 two days ago.
2010-01-26Minor comment fix.Lasse Collin1-2/+2
2010-01-24Add initial version of xz --list.Lasse Collin5-359/+668
This is a bit rough but should be useful for basic things. Ideas (with detailed examples) about the output format are welcome. The output of --robot --list is not necessarily stable yet, although I don't currently have any plans about changing it. The man page hasn't been updated yet.
2010-01-24Add io_pread().Lasse Collin2-0/+42
It will be used by --list.
2010-01-24Set LC_NUMERIC=C when --robot is used.Lasse Collin1-0/+4
It is to ensure that floating point numbers will always have a dot as the decimal separator.
2010-01-24Some improvements to printing sizes in xz.Lasse Collin5-90/+166
2010-01-15Update the xz man page to match the previous two commits.Lasse Collin1-6/+3
2010-01-13Don't read compressed data from a terminal or write itLasse Collin2-15/+13
to a terminal even if --force is specified. It just seems more reasonable this way. The new behavior matches bzip2. The old one matched gzip.
2010-01-13Don't compress or decompress special files unless writingLasse Collin1-5/+10
to stdout even if --force is used. --force will still enable compression of symlinks, but only in case they point to a regular file. The new way simply seems more reasonable. It matches gzip's behavior while the old one matched bzip2's behavior.
2009-12-07Fix file_io.c on DOS-like systems.Lasse Collin1-0/+4
The problem was introduced when adding sparse file support in 465d1b0d6518c5d980f2db4c2d769f9905bdd902. Thanks to Charles Wilson.
2009-12-07Add a note for translators to add a bug reporting addressLasse Collin1-0/+4
for translation bugs.
2009-12-07Prevent xgettext from taking one regular string as a C format string.Lasse Collin1-1/+1
Thanks to Marek Černocký.
2009-11-28Remove duplicate code in io_open_dest().Lasse Collin1-8/+1
Fix a missing _() in the error message too.
2009-11-25Add missing error check to coder.c.Lasse Collin1-9/+11
With bad luck this could cause a segfault due to reading (but not writing) past the end of the buffer.
2009-11-25Create sparse files by default when decompressing intoLasse Collin6-56/+272
a regular file. Sparse file creation can be disabled with --no-sparse. I don't promise yet that the name of this option won't change before 5.0.0. It's possible that the code, that checks when it is safe to use sparse output on stdout, is not good enough, and a more flexible command line option is needed to configure sparse file handling.
2009-11-16Add support for --info-memory and --robot to xz.Lasse Collin6-55/+133
Currently --robot works only with --info-memory and --version. --help and --long-help work too, but --robot has no effect on them. Thanks to Jonathan Nieder for the original patches.
2009-11-15Add lzma_physmem().Lasse Collin2-3/+1
I had hoped to keep liblzma as purely a compression library as possible (e.g. file I/O will go into a different library), but it seems that applications linking agaisnt liblzma need some way to determine the memory usage limit, and knowing the amount of RAM is one reasonable way to help making such decisions. Thanks to Jonathan Nieder for the original patch.
2009-11-14Some updates to xz man page.Lasse Collin1-5/+49
2009-11-14Fix description of --memory in --long-help.Lasse Collin1-2/+1
2009-11-14Fix a design error in liblzma API.Lasse Collin1-1/+0
Originally the idea was that using LZMA_FULL_FLUSH with Stream encoder would read the filter chain from the same array that was used to intialize the Stream encoder. Since most apps wouldn't use LZMA_FULL_FLUSH, most apps wouldn't need to keep the filter chain available after initializing the Stream encoder. However, due to my mistake, it actually required keeping the array always available. Since setting the new filter chain via the array used at initialization time is not a nice way to do it for a couple of reasons, this commit ditches it and introduces lzma_filters_update(). This new function replaces also the "persistent" flag used by LZMA2 (and to-be-designed Subblock filter), which was also an ugly thing to do. Thanks to Alexey Tourbin for reminding me about the problem that Stream encoder used to require keeping the filter chain allocated.
2009-10-16Mention --check=none in --long-help. It was already inLasse Collin1-1/+1
the man page though. Thanks to Jim Meyering for noticing this.
2009-10-02Add support for --enable-assume-ram=SIZE.Lasse Collin1-4/+3
2009-09-24Fix an error in OpenVMS-specific code.Lasse Collin1-1/+1
Thanks to Jouk Jansen.
2009-09-22Better fixes for OpenVMS support.Lasse Collin1-3/+16
Thanks to Jouk Jansen.
2009-09-19Various changes.Lasse Collin12-155/+88
Separate a few reusable components from XZ Utils specific code. The reusable code is now in "tuklib" modules. A few more could be separated still, e.g. bswap.h. Fix some bugs in lzmainfo. Fix physmem and cpucores code on OS/2. Thanks to Elbert Pol for help. Add OpenVMS support into physmem. Add a few #ifdefs to ease building XZ Utils on OpenVMS. Thanks to Jouk Jansen for the original patch.
2009-09-12A few grammar fixes.Lasse Collin1-11/+11
Thanks to Christian Weisgerber for pointing out some of these.
2009-09-11Use $(LN_EXEEXT) in symlinks to executables.Lasse Collin1-2/+2
This fixes "make install" on operating systems using a suffix for executables. Cygwin is treated specially. The symlink names won't have .exe suffix even though the executables themselves have. Thanks to Charles Wilson.
2009-09-01Refactored option parsing.Lasse Collin1-35/+35
2009-09-01Fix options parsing bug in xz.Lasse Collin1-4/+2
xz used to reject "xz --lzma2=pb=2," while "xz --lzma2=pb=2,," worked. Now both work.
2009-08-29Use even more hackish way to support thousand separators.Lasse Collin1-11/+25
Seems that in addition on Windows and DOS, also OpenBSD lacks support for %'d style printf() format strings. So far that is the only modern POSIX-like system I know with this problem, but after this hack, the thousand separator shouldn't be a problem on any system. Maybe testing if a format string like %'d produces reasonable output is invoking undefined behavior on some systems, but so far all the problematic systems I've tried just print the raw format string (e.g. %'d prints 'd). Maybe Autoconf test would have been better, but this hack works also for cross-compilation, and avoids recompilation in case the system libc starts to support the thousand separator.
2009-08-27Update xz man page date.Lasse Collin1-1/+1
2009-08-27Some xz man page improvements.Lasse Collin1-16/+62
2009-08-17Some xz man changes.Lasse Collin1-45/+43
2009-08-13Fix xz Makefile.am for the man page.Lasse Collin1-0/+2
install-exec-hook -> install-data-hook
2009-08-13Sync some error messages from xz to xzdec.Lasse Collin1-2/+2
Make xz error message translation usable outside xz (at least in upcoming lzmainfo).
2009-08-13Fix first line of xz man page.Lasse Collin1-1/+1
2009-08-10Added a rough version of the xz man page.Lasse Collin2-0/+1221
2009-07-23Fix incorrect usage of getopt_long(), which causedLasse Collin1-1/+0
invalid memory access if XZ_OPT was defined.
2009-07-20Avoid internal error with --format=xz --lzma1.Lasse Collin1-4/+12
2009-07-18Added public domain notice into a few files.Lasse Collin1-0/+7
2009-07-14Allow extra commas in filter-specific options on xz command line.Lasse Collin1-0/+7
This may slightly ease writing scripts that construct filter-specific option strings dynamically.
2009-07-14Accept --lzma2=preset=6e where "e" is equivalent to --extremeLasse Collin1-21/+59
when no custom chain is in use.
2009-07-10Look for full command names instead of substringsLasse Collin1-9/+13
like "un", "cat", and "lz" when determining if xz is run as unxz, xzcat, lzma, unlzma, or lzcat. This is to ensure that if xz is renamed (e.g. via --program-transform-name), it doesn't so easily work in wrong mode.
2009-07-06Use sed instead of $(SED) so that we don't need toLasse Collin1-3/+3
use AC_PROG_SED. We don't do anything fancy with sed, so this should work OK. libtool 2.2 sets SED but 1.5 doesn't, so $(SED) happened to work when using libtool 2.2.
2009-07-04Make "xz --decompress --stdout --force" copy unrecognizedLasse Collin1-35/+178
files as is to standard output. This feature is needed to be more compatible with gzip's behavior. This was more complicated to implement than it sounds, because the way liblzma is able to return errors with files of only a few bytes in size. xz now has its own file type detection code and no longer uses lzma_auto_decoder().
2009-07-02Define PACKAGE_HOMEPAGE in configure.ac and use it inLasse Collin1-2/+2
xz and xzdec. Use also PACKAGE_NAME instead of hardcoding "XZ Utils".
2009-06-30Build system fixesLasse Collin1-1/+10
Don't use libtool convenience libraries to avoid recently discovered long-standing subtle but somewhat severe bugs in libtool (at least 1.5.22 and 2.2.6 are affected). It was found when porting XZ Utils to Windows <http://lists.gnu.org/archive/html/libtool/2009-06/msg00070.html> but the problem is significant also e.g. on GNU/Linux. Unless --disable-shared is passed to configure, static library built from a set of convenience libraries will contain PIC objects. That is, while libtool builds non-PIC objects too, only PIC objects will be used from the convenience libraries. On 32-bit x86 (tested on mobile XP2400+), using PIC instead of non-PIC makes the decompressor 10 % slower with the default CFLAGS. So while xz was linked against static liblzma by default, it got the slower PIC objects unless --disable-shared was used. I tend develop and benchmark with --disable-shared due to faster build time, so I hadn't noticed the problem in benchmarks earlier. This commit also adds support for building Windows resources into liblzma and executables.
2009-06-27Moved the Windows resource files outside the windows directoryLasse Collin1-0/+5
to prepare for building them with Autotools.
2009-06-27Added missing $(EXEEXT).Lasse Collin1-1/+1
2009-06-27Create correct symlinks even whenLasse Collin1-8/+13
--program-{prefix,suffix,transform} is passed to configure.
2009-06-27Silence a compiler warning on DOS-like systems.Lasse Collin1-1/+4
2009-06-26Updated comments to match renamed files.Lasse Collin4-4/+4
2009-06-26Rename process.[hc] to coder.[hc] and io.[hc] to file_io.[hc]Lasse Collin6-6/+6
to avoid problems on systems with system headers with those names.
2009-06-26Rename process_file() to coder_run().Lasse Collin3-9/+8
2009-06-26Ugly hack to make it possible to use the thousand separatorLasse Collin4-23/+78
format character with snprintf() on POSIX systems but not on non-POSIX systems and still keep xgettext working.
2009-06-26Fix @variables@ to $(variables) in Makefile.am files.Lasse Collin1-10/+11
Fix the ordering of libgnu.a and LTLIBINTL on the linker command line and added missing LTLIBINTL to tests/Makefile.am.
2009-06-24Cast a char argument to isspace() to unsigned char.Lasse Collin1-2/+9
2009-05-23Remove undocumented alternative option names --bcj, --ppc,Lasse Collin1-3/+0
and --itanium.
2009-05-23Add support for specifying the BCJ filter start offsetLasse Collin4-21/+76
in the xz command line tool.
2009-05-22Add --no-warn.Lasse Collin4-1/+34
2009-05-22Fix a comment.Lasse Collin1-1/+1
2009-05-22Remove the --info option, which was an alias for --list.Lasse Collin1-1/+0