]> granicus.if.org Git - xz/log
xz
4 years agoScripts: Put /usr/xpg4/bin to the beginning of PATH on Solaris. master
Lasse Collin [Tue, 24 Sep 2019 20:02:40 +0000 (23:02 +0300)]
Scripts: Put /usr/xpg4/bin to the beginning of PATH on Solaris.

This adds a configure option --enable-path-for-scripts=PREFIX
which defaults to empty except on Solaris it is /usr/xpg4/bin
to make POSIX grep and others available. The Solaris case had
been documented in INSTALL with a manual fix but it's better
to do this automatically since it is needed on most Solaris
systems anyway.

Thanks to Daniel Richard G.

4 years agoFix comment typos in tuklib_mbstr* files.
Lasse Collin [Fri, 12 Jul 2019 15:57:43 +0000 (18:57 +0300)]
Fix comment typos in tuklib_mbstr* files.

4 years agoAdd missing include to tuklib_mbstr_width.c.
Lasse Collin [Fri, 12 Jul 2019 15:30:46 +0000 (18:30 +0300)]
Add missing include to tuklib_mbstr_width.c.

It didn't matter in XZ Utils because sysdefs.h
includes string.h anyway.

4 years agoUpdate tuklib base headers to include stdbool.h.
Lasse Collin [Fri, 12 Jul 2019 15:10:57 +0000 (18:10 +0300)]
Update tuklib base headers to include stdbool.h.

4 years agoxz: Automatically align the strings in --info-memory.
Lasse Collin [Thu, 27 Jun 2019 21:54:31 +0000 (00:54 +0300)]
xz: Automatically align the strings in --info-memory.

This makes it easier to translate the strings.

Also, the string for amount of RAM was shortened.

4 years agoliblzma: Fix a buggy comment.
Lasse Collin [Tue, 25 Jun 2019 20:15:21 +0000 (23:15 +0300)]
liblzma: Fix a buggy comment.

4 years agoconfigure.ac: Fix a typo in a comment.
Lasse Collin [Mon, 24 Jun 2019 21:16:06 +0000 (00:16 +0300)]
configure.ac: Fix a typo in a comment.

4 years agoTests: Silence warnings from clang -Wassign-enum.
Lasse Collin [Mon, 24 Jun 2019 21:08:13 +0000 (00:08 +0300)]
Tests: Silence warnings from clang -Wassign-enum.

Also changed 999 to 99 so it fits even if lzma_check happened
to be 8 bits wide.

4 years agoliblzma: Add a comment.
Lasse Collin [Mon, 24 Jun 2019 20:52:17 +0000 (23:52 +0300)]
liblzma: Add a comment.

4 years agoliblzma: Silence clang -Wmissing-variable-declarations.
Lasse Collin [Mon, 24 Jun 2019 20:45:21 +0000 (23:45 +0300)]
liblzma: Silence clang -Wmissing-variable-declarations.

4 years agoAdd LZMA_RET_INTERNAL1..8 to lzma_ret and use one for LZMA_TIMED_OUT.
Lasse Collin [Mon, 24 Jun 2019 20:25:41 +0000 (23:25 +0300)]
Add LZMA_RET_INTERNAL1..8 to lzma_ret and use one for LZMA_TIMED_OUT.

LZMA_TIMED_OUT is *internally* used as a value for lzma_ret
enumeration. Previously it was #defined to 32 and cast to lzma_ret.
That way it wasn't visible in the public API, but this was hackish.

Now the public API has eight LZMA_RET_INTERNALx members and
LZMA_TIMED_OUT is #defined to LZMA_RET_INTERNAL1. This way
the code is cleaner overall although the public API has a few
extra mysterious enum members.

4 years agoxz: Silence a warning from clang -Wsign-conversion in main.c.
Lasse Collin [Mon, 24 Jun 2019 19:57:43 +0000 (22:57 +0300)]
xz: Silence a warning from clang -Wsign-conversion in main.c.

4 years agoxz: Make "headings" static in list.c.
Lasse Collin [Mon, 24 Jun 2019 19:52:20 +0000 (22:52 +0300)]
xz: Make "headings" static in list.c.

Caught by clang -Wmissing-variable-declarations.

4 years agoliblzma: Remove incorrect uses of lzma_attribute((__unused__)).
Lasse Collin [Mon, 24 Jun 2019 19:47:39 +0000 (22:47 +0300)]
liblzma: Remove incorrect uses of lzma_attribute((__unused__)).

Caught by clang -Wused-but-marked-unused.

4 years agoTests: Silence a warning from -Wsign-conversion.
Lasse Collin [Mon, 24 Jun 2019 17:53:55 +0000 (20:53 +0300)]
Tests: Silence a warning from -Wsign-conversion.

4 years agoxz: Fix an integer overflow with 32-bit off_t.
Lasse Collin [Mon, 24 Jun 2019 17:45:49 +0000 (20:45 +0300)]
xz: Fix an integer overflow with 32-bit off_t.

Or any off_t which isn't very big (like signed 64 bit integer
that most system have). A small off_t could overflow if the
file being decompressed had long enough run of zero bytes,
which would result in corrupt output.

4 years agoxz: Cleanup io_seek_src() a bit.
Lasse Collin [Sun, 23 Jun 2019 22:24:17 +0000 (01:24 +0300)]
xz: Cleanup io_seek_src() a bit.

lseek() returns -1 on error and checking for -1 is nicer.

4 years agoTests: Remove a duplicate branch from tests/tests.h.
Lasse Collin [Sun, 23 Jun 2019 21:57:23 +0000 (00:57 +0300)]
Tests: Remove a duplicate branch from tests/tests.h.

The duplication was introduced about eleven years ago and
should have been cleaned up back then already.

This was caught by -Wduplicated-branches.

4 years agoxz: Change io_seek_src and io_pread arguments from off_t to uint64_t.
Lasse Collin [Sun, 23 Jun 2019 21:40:45 +0000 (00:40 +0300)]
xz: Change io_seek_src and io_pread arguments from off_t to uint64_t.

This helps fixing warnings from -Wsign-conversion and makes the
code look better too.

4 years agoxz: list.c: Fix some warnings from -Wsign-conversion.
Lasse Collin [Sun, 23 Jun 2019 21:12:38 +0000 (00:12 +0300)]
xz: list.c: Fix some warnings from -Wsign-conversion.

4 years agotuklib_mbstr_width: Fix a warning from -Wsign-conversion.
Lasse Collin [Sun, 23 Jun 2019 20:22:45 +0000 (23:22 +0300)]
tuklib_mbstr_width: Fix a warning from -Wsign-conversion.

4 years agoxz: Fix some of the warnings from -Wsign-conversion.
Lasse Collin [Sun, 23 Jun 2019 20:19:34 +0000 (23:19 +0300)]
xz: Fix some of the warnings from -Wsign-conversion.

4 years agotuklib_cpucores: Silence warnings from -Wsign-conversion.
Lasse Collin [Sun, 23 Jun 2019 19:27:45 +0000 (22:27 +0300)]
tuklib_cpucores: Silence warnings from -Wsign-conversion.

4 years agoxzdec: Fix warnings from -Wsign-conversion.
Lasse Collin [Sun, 23 Jun 2019 18:40:47 +0000 (21:40 +0300)]
xzdec: Fix warnings from -Wsign-conversion.

4 years agoliblzma: Fix warnings from -Wsign-conversion.
Lasse Collin [Sun, 23 Jun 2019 18:38:56 +0000 (21:38 +0300)]
liblzma: Fix warnings from -Wsign-conversion.

Also, more parentheses were added to the literal_subcoder
macro in lzma_comon.h (better style but no functional change
in the current usage).

4 years agotuklib_integer: Silence warnings from -Wsign-conversion.
Lasse Collin [Sun, 23 Jun 2019 16:33:55 +0000 (19:33 +0300)]
tuklib_integer: Silence warnings from -Wsign-conversion.

4 years agotuklib_integer: Fix usage of conv macros.
Lasse Collin [Thu, 20 Jun 2019 16:40:30 +0000 (19:40 +0300)]
tuklib_integer: Fix usage of conv macros.

Use a temporary variable instead of e.g.
conv32le(unaligned_read32ne(buf)) because the macro can
evaluate its argument multiple times.

4 years agoUpdate THANKS.
Lasse Collin [Mon, 3 Jun 2019 17:44:19 +0000 (20:44 +0300)]
Update THANKS.

4 years agoliblzma: Fix comments.
Lasse Collin [Mon, 3 Jun 2019 17:41:54 +0000 (20:41 +0300)]
liblzma: Fix comments.

Thanks to Bruce Stark.

4 years agoliblzma: Fix one more unaligned read to use unaligned_read16ne().
Lasse Collin [Sat, 1 Jun 2019 21:50:59 +0000 (00:50 +0300)]
liblzma: Fix one more unaligned read to use unaligned_read16ne().

4 years agoUpdate THANKS.
Lasse Collin [Sat, 1 Jun 2019 18:41:55 +0000 (21:41 +0300)]
Update THANKS.

4 years agoliblzma: memcmplen: Use ctz32() from tuklib_integer.h.
Lasse Collin [Sat, 1 Jun 2019 18:36:13 +0000 (21:36 +0300)]
liblzma: memcmplen: Use ctz32() from tuklib_integer.h.

The same compiler-specific #ifdefs are already in tuklib_integer.h

4 years agotuklib_integer: Cleanup MSVC-specific code.
Lasse Collin [Sat, 1 Jun 2019 18:30:03 +0000 (21:30 +0300)]
tuklib_integer: Cleanup MSVC-specific code.

4 years agoliblzma: Use unaligned_readXXne functions instead of type punning.
Lasse Collin [Sat, 1 Jun 2019 16:01:21 +0000 (19:01 +0300)]
liblzma: Use unaligned_readXXne functions instead of type punning.

Now gcc -fsanitize=undefined should be clean.

Thanks to Jeffrey Walton.

4 years agotuklib_integer: Autodetect support for unaligned access on ARM.
Lasse Collin [Sat, 1 Jun 2019 15:46:54 +0000 (18:46 +0300)]
tuklib_integer: Autodetect support for unaligned access on ARM.

The result is used as the default for --enable-unaligned-access.
The test should work with GCC and Clang.

4 years agotuklib_integer: Improve unaligned memory access.
Lasse Collin [Sat, 1 Jun 2019 15:41:16 +0000 (18:41 +0300)]
tuklib_integer: Improve unaligned memory access.

Now memcpy() or GNU C packed structs for unaligned access instead
of type punning. See the comment in this commit for details.

Avoiding type punning with unaligned access is needed to
silence gcc -fsanitize=undefined.

New functions: unaliged_readXXne and unaligned_writeXXne where
XX is 16, 32, or 64.

4 years agoliblzma: Avoid memcpy(NULL, foo, 0) because it is undefined behavior.
Lasse Collin [Mon, 13 May 2019 17:05:17 +0000 (20:05 +0300)]
liblzma: Avoid memcpy(NULL, foo, 0) because it is undefined behavior.

I should have always known this but I didn't. Here is an example
as a reminder to myself:

    int mycopy(void *dest, void *src, size_t n)
    {
        memcpy(dest, src, n);
        return dest == NULL;
    }

In the example, a compiler may assume that dest != NULL because
passing NULL to memcpy() would be undefined behavior. Testing
with GCC 8.2.1, mycopy(NULL, NULL, 0) returns 1 with -O0 and -O1.
With -O2 the return value is 0 because the compiler infers that
dest cannot be NULL because it was already used with memcpy()
and thus the test for NULL gets optimized out.

In liblzma, if a null-pointer was passed to memcpy(), there were
no checks for NULL *after* the memcpy() call, so I cautiously
suspect that it shouldn't have caused bad behavior in practice,
but it's hard to be sure, and the problematic cases had to be
fixed anyway.

Thanks to Jeffrey Walton.

4 years agoUpdate THANKS.
Lasse Collin [Sat, 11 May 2019 17:56:08 +0000 (20:56 +0300)]
Update THANKS.

4 years agoxz: Update xz man page date.
Lasse Collin [Sat, 11 May 2019 17:54:12 +0000 (20:54 +0300)]
xz: Update xz man page date.

4 years agospelling
Antoine Cœur [Wed, 8 May 2019 05:30:57 +0000 (13:30 +0800)]
spelling

5 years agoxz: In xz -lvv look at the widths of the check names too.
Lasse Collin [Wed, 1 May 2019 15:43:10 +0000 (18:43 +0300)]
xz: In xz -lvv look at the widths of the check names too.

Now the widths of the check names is used to adjust the width
of the Check column. This way there no longer is a need to restrict
the widths of the check names to be at most ten terminal-columns.

5 years agoxz: Fix xz -lvv column alignment to look at the translated strings.
Lasse Collin [Wed, 1 May 2019 15:33:25 +0000 (18:33 +0300)]
xz: Fix xz -lvv column alignment to look at the translated strings.

5 years agoUpdate THANKS.
Lasse Collin [Wed, 1 May 2019 13:52:36 +0000 (16:52 +0300)]
Update THANKS.

5 years agoWindows: Update VS version in windows/vs2019/config.h.
Lasse Collin [Wed, 1 May 2019 13:43:16 +0000 (16:43 +0300)]
Windows: Update VS version in windows/vs2019/config.h.

5 years agoWindows: Upgrade solution itself
Julien Marrec [Thu, 25 Apr 2019 15:44:06 +0000 (17:44 +0200)]
Windows: Upgrade solution itself

5 years agoWindows: Upgrade solution with VS2019
Julien Marrec [Thu, 25 Apr 2019 15:40:24 +0000 (17:40 +0200)]
Windows: Upgrade solution with VS2019

5 years agoWindows: Duplicate windows/vs2017 before upgrading
Julien Marrec [Thu, 25 Apr 2019 15:39:32 +0000 (17:39 +0200)]
Windows: Duplicate windows/vs2017 before upgrading

5 years agoREADME: Update translation instructions.
Lasse Collin [Mon, 4 Mar 2019 20:49:04 +0000 (22:49 +0200)]
README: Update translation instructions.

XZ Utils is now part of the Translation Project
<https://translationproject.org/>.

5 years agoxz: Automatically align column headings in xz -lvv.
Lasse Collin [Mon, 4 Mar 2019 19:20:39 +0000 (21:20 +0200)]
xz: Automatically align column headings in xz -lvv.

5 years agoxz: Automatically align strings ending in a colon in --list output.
Lasse Collin [Sun, 3 Mar 2019 23:07:59 +0000 (01:07 +0200)]
xz: Automatically align strings ending in a colon in --list output.

This should avoid alignment errors in translations with these
strings.

5 years agoWindows/VS2017: Omit WindowsTargetPlatformVersion from project files.
Lasse Collin [Sun, 13 Jan 2019 15:29:23 +0000 (17:29 +0200)]
Windows/VS2017: Omit WindowsTargetPlatformVersion from project files.

I understood that if a WTPV is specified, it's often wrong
because different VS installations have different SDK version
installed. Omitting the WTPV tag makes VS2017 default to
Windows SDK 8.1 which often is also missing, so in any case
people may need to specify the WTPV before building. But some
day in the future a missing WTPV tag will start to default to
the latest installed SDK which sounds reasonable:

https://developercommunity.visualstudio.com/content/problem/140294/windowstargetplatformversion-makes-it-impossible-t.html

Thanks to "dom".

5 years agoUpdate THANKS.
Lasse Collin [Thu, 20 Dec 2018 18:42:29 +0000 (20:42 +0200)]
Update THANKS.

5 years agoxz: Fix a crash in progress indicator when in passthru mode.
Lasse Collin [Fri, 14 Dec 2018 18:34:30 +0000 (20:34 +0200)]
xz: Fix a crash in progress indicator when in passthru mode.

"xz -dcfv not_an_xz_file" crashed (all four options are
required to trigger it). It caused xz to call
lzma_get_progress(&strm, ...) when no coder was initialized
in strm. In this situation strm.internal is NULL which leads
to a crash in lzma_get_progress().

The bug was introduced when xz started using lzma_get_progress()
to get progress info for multi-threaded compression, so the
bug is present in versions 5.1.3alpha and higher.

Thanks to Filip Palian <Filip.Palian@pjwstk.edu.pl> for
the bug report.

5 years agoxz: Update man page timestamp.
Lasse Collin [Thu, 22 Nov 2018 15:20:31 +0000 (17:20 +0200)]
xz: Update man page timestamp.

5 years ago'have have' typos
Pavel Raiskup [Thu, 22 Nov 2018 14:14:34 +0000 (15:14 +0100)]
'have have' typos

5 years agoUpdate THANKS.
Lasse Collin [Fri, 2 Nov 2018 18:40:48 +0000 (20:40 +0200)]
Update THANKS.

5 years agoTests: Add a fuzz test program and a config file for OSS-Fuzz.
Lasse Collin [Fri, 2 Nov 2018 18:18:45 +0000 (20:18 +0200)]
Tests: Add a fuzz test program and a config file for OSS-Fuzz.

Thanks to Bhargava Shastry and Github user pdknsk.

5 years agoliblzma: Don't verify header CRC32s if building for fuzz testing.
Lasse Collin [Fri, 26 Oct 2018 19:49:10 +0000 (22:49 +0300)]
liblzma: Don't verify header CRC32s if building for fuzz testing.

FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION is #defined when liblzma
is being built for fuzz testing.

Most fuzzed inputs would normally get rejected because of incorrect
CRC32 and the actual header decoding code wouldn't get fuzzed.
Disabling CRC32 checks avoids this problem. The fuzzer program
must still use LZMA_IGNORE_CHECK flag to disable verification of
integrity checks of uncompressed data.

5 years agoxzless: Rename unused variables to silence static analysers.
Lasse Collin [Fri, 27 Jul 2018 15:10:44 +0000 (18:10 +0300)]
xzless: Rename unused variables to silence static analysers.

In this particular case I don't see this affecting readability
of the code.

Thanks to Pavel Raiskup.

5 years agoliblzma: Remove an always-true condition from lzma_index_cat().
Lasse Collin [Fri, 27 Jul 2018 13:02:58 +0000 (16:02 +0300)]
liblzma: Remove an always-true condition from lzma_index_cat().

This should help static analysis tools to see that newg
isn't leaked.

Thanks to Pavel Raiskup.

5 years agoliblzma: Improve lzma_properties_decode() API documentation.
Lasse Collin [Sat, 19 May 2018 18:23:25 +0000 (21:23 +0300)]
liblzma: Improve lzma_properties_decode() API documentation.

6 years agoBump the version number to 5.3.1alpha. v5.3.1alpha
Lasse Collin [Sun, 29 Apr 2018 15:58:19 +0000 (18:58 +0300)]
Bump the version number to 5.3.1alpha.

6 years agoextra/scanlzma: Fix compiler warnings.
Lasse Collin [Sun, 29 Apr 2018 15:48:00 +0000 (18:48 +0300)]
extra/scanlzma: Fix compiler warnings.

6 years agoDOS: Add file_info.c to the list of files to build.
Lasse Collin [Sun, 29 Apr 2018 15:44:47 +0000 (18:44 +0300)]
DOS: Add file_info.c to the list of files to build.

6 years agoUpdate NEWS for 5.3.1alpha.
Lasse Collin [Sun, 29 Apr 2018 15:33:10 +0000 (18:33 +0300)]
Update NEWS for 5.3.1alpha.

6 years agoAdd NEWS for 5.2.4.
Lasse Collin [Sun, 29 Apr 2018 15:15:37 +0000 (18:15 +0300)]
Add NEWS for 5.2.4.

6 years agoUpdate THANKS.
Lasse Collin [Tue, 6 Feb 2018 17:36:30 +0000 (19:36 +0200)]
Update THANKS.

6 years agonothrow: use noexcept for C++11 and newer
Ben Boeckel [Mon, 29 Jan 2018 18:58:18 +0000 (13:58 -0500)]
nothrow: use noexcept for C++11 and newer

In C++11, the `throw()` specifier is deprecated and `noexcept` is
preffered instead.

6 years agoliblzma: Remove incorrect #ifdef from range_common.h.
Lasse Collin [Tue, 6 Feb 2018 16:02:48 +0000 (18:02 +0200)]
liblzma: Remove incorrect #ifdef from range_common.h.

In most cases it was harmless but it could affect some
custom build systems.

Thanks to Pippijn van Steenhoven.

6 years agoUpdate THANKS.
Lasse Collin [Wed, 10 Jan 2018 20:10:39 +0000 (22:10 +0200)]
Update THANKS.

6 years agotuklib_integer: New Intel C compiler needs immintrin.h.
Lasse Collin [Wed, 10 Jan 2018 19:54:27 +0000 (21:54 +0200)]
tuklib_integer: New Intel C compiler needs immintrin.h.

Thanks to Melanie Blower (Intel) for the patch.

6 years agoUpdate THANKS.
Lasse Collin [Sun, 24 Sep 2017 17:04:24 +0000 (20:04 +0300)]
Update THANKS.

6 years agoWindows: Fix paths in VS project files.
Lasse Collin [Sat, 16 Sep 2017 17:36:20 +0000 (20:36 +0300)]
Windows: Fix paths in VS project files.

Some paths use slashes instead of backslashes as directory
separators... now it should work (I tested VS2013 version).

6 years agoWindows: Update VS2017 project files to include file info decoder.
Lasse Collin [Sat, 16 Sep 2017 09:56:20 +0000 (12:56 +0300)]
Windows: Update VS2017 project files to include file info decoder.

6 years agoWindows: Add project files for VS2017.
Lasse Collin [Sat, 16 Sep 2017 09:54:23 +0000 (12:54 +0300)]
Windows: Add project files for VS2017.

These files match the v5.2 branch (no file info decoder).

6 years agoWindows: Update VS2013 project files to include file info decoder.
Lasse Collin [Sat, 16 Sep 2017 09:45:50 +0000 (12:45 +0300)]
Windows: Update VS2013 project files to include file info decoder.

6 years agoWindows: Move VS2013 files into windows/vs2013 directory.
Lasse Collin [Sat, 16 Sep 2017 09:39:43 +0000 (12:39 +0300)]
Windows: Move VS2013 files into windows/vs2013 directory.

6 years agoFix or hide warnings from GCC 7's -Wimplicit-fallthrough.
Lasse Collin [Mon, 14 Aug 2017 17:08:33 +0000 (20:08 +0300)]
Fix or hide warnings from GCC 7's -Wimplicit-fallthrough.

6 years agoDocs: Fix a typo in a comment in doc/examples/02_decompress.c.
Alexey Tourbin [Tue, 16 May 2017 20:56:35 +0000 (23:56 +0300)]
Docs: Fix a typo in a comment in doc/examples/02_decompress.c.

6 years agoxz: Fix "xz --list --robot missing_or_bad_file.xz".
Lasse Collin [Tue, 23 May 2017 15:34:43 +0000 (18:34 +0300)]
xz: Fix "xz --list --robot missing_or_bad_file.xz".

It ended up printing an uninitialized char-array when trying to
print the check names (column 7) on the "totals" line.

This also changes the column 12 (minimum xz version) to
50000002 (xz 5.0.0) instead of 0 when there are no valid
input files.

Thanks to kidmin for the bug report.

7 years agoDocs: Add doc/examples/11_file_info.c.
Lasse Collin [Mon, 24 Apr 2017 17:20:11 +0000 (20:20 +0300)]
Docs: Add doc/examples/11_file_info.c.

7 years agoBuild: Omit pre-5.0.0 entries from the generated ChangeLog.
Lasse Collin [Mon, 24 Apr 2017 16:48:47 +0000 (19:48 +0300)]
Build: Omit pre-5.0.0 entries from the generated ChangeLog.

It makes ChangeLog significantly smaller.

7 years agoxz: Use lzma_file_info_decoder() for --list.
Lasse Collin [Mon, 24 Apr 2017 16:48:23 +0000 (19:48 +0300)]
xz: Use lzma_file_info_decoder() for --list.

7 years agoliblzma: Add lzma_file_info_decoder().
Lasse Collin [Mon, 24 Apr 2017 16:35:50 +0000 (19:35 +0300)]
liblzma: Add lzma_file_info_decoder().

7 years agoUpdate the Git repository URL to HTTPS in ChangeLog.
Lasse Collin [Mon, 24 Apr 2017 16:30:22 +0000 (19:30 +0300)]
Update the Git repository URL to HTTPS in ChangeLog.

7 years agoliblzma: Rename LZMA_SEEK to LZMA_SEEK_NEEDED and seek_in to seek_pos.
Lasse Collin [Fri, 21 Apr 2017 12:05:16 +0000 (15:05 +0300)]
liblzma: Rename LZMA_SEEK to LZMA_SEEK_NEEDED and seek_in to seek_pos.

7 years agoUpdate the home page URLs to HTTPS.
Lasse Collin [Wed, 19 Apr 2017 19:17:35 +0000 (22:17 +0300)]
Update the home page URLs to HTTPS.

7 years agoxz: Add io_seek_src().
Lasse Collin [Wed, 5 Apr 2017 15:47:22 +0000 (18:47 +0300)]
xz: Add io_seek_src().

7 years agoxz: Use POSIX_FADV_RANDOM for in "xz --list" mode.
Lasse Collin [Thu, 30 Mar 2017 19:01:54 +0000 (22:01 +0300)]
xz: Use POSIX_FADV_RANDOM for in "xz --list" mode.

xz --list is random access so POSIX_FADV_SEQUENTIAL was clearly
wrong.

7 years agoliblzma: Make lzma_index_decoder_init() visible to other liblzma funcs.
Lasse Collin [Thu, 30 Mar 2017 17:03:05 +0000 (20:03 +0300)]
liblzma: Make lzma_index_decoder_init() visible to other liblzma funcs.

This is to allow other functions to use it without going
via the public API (lzma_index_decoder()).

7 years agoliblzma: Add generic support for input seeking (LZMA_SEEK).
Lasse Collin [Thu, 30 Mar 2017 17:00:09 +0000 (20:00 +0300)]
liblzma: Add generic support for input seeking (LZMA_SEEK).

Also mention LZMA_SEEK in xz/message.c to silence a warning.

7 years agoliblzma: Fix lzma_memlimit_set(strm, 0).
Lasse Collin [Thu, 30 Mar 2017 16:47:45 +0000 (19:47 +0300)]
liblzma: Fix lzma_memlimit_set(strm, 0).

The 0 got treated specially in a buggy way and as a result
the function did nothing. The API doc said that 0 was supposed
to return LZMA_PROG_ERROR but it didn't.

Now 0 is treated as if 1 had been specified. This is done because
0 is already used to indicate an error from lzma_memlimit_get()
and lzma_memusage().

In addition, lzma_memlimit_set() no longer checks that the new
limit is at least LZMA_MEMUSAGE_BASE. It's counter-productive
for the Index decoder and was actually needed only by the
auto decoder. Auto decoder has now been modified to check for
LZMA_MEMUSAGE_BASE.

7 years agoliblzma: Similar memlimit fix for stream_, alone_, and auto_decoder.
Lasse Collin [Thu, 30 Mar 2017 16:16:55 +0000 (19:16 +0300)]
liblzma: Similar memlimit fix for stream_, alone_, and auto_decoder.

7 years agoliblzma: Fix handling of memlimit == 0 in lzma_index_decoder().
Lasse Collin [Thu, 30 Mar 2017 15:58:18 +0000 (18:58 +0300)]
liblzma: Fix handling of memlimit == 0 in lzma_index_decoder().

It returned LZMA_PROG_ERROR, which was done to avoid zero as
the limit (because it's a special value elsewhere), but using
LZMA_PROG_ERROR is simply inconvenient and can cause bugs.

The fix/workaround is to treat 0 as if it were 1 byte. It's
effectively the same thing. The only weird consequence is
that then lzma_memlimit_get() will return 1 even when 0 was
specified as the limit.

This fixes a very rare corner case in xz --list where a specific
memory usage limit and a multi-stream file could print the
error message "Internal error (bug)" instead of saying that
the memory usage limit is too low.

7 years agoUpdate NEWS for 5.2.3.
Lasse Collin [Fri, 30 Dec 2016 11:25:10 +0000 (13:25 +0200)]
Update NEWS for 5.2.3.

7 years agoDocument --enable-sandbox configure option in INSTALL.
Lasse Collin [Mon, 26 Dec 2016 18:55:52 +0000 (20:55 +0200)]
Document --enable-sandbox configure option in INSTALL.

7 years agoliblzma: Avoid multiple definitions of lzma_coder structures.
Lasse Collin [Mon, 21 Nov 2016 18:24:50 +0000 (20:24 +0200)]
liblzma: Avoid multiple definitions of lzma_coder structures.

Only one definition was visible in a translation unit.
It avoided a few casts and temp variables but seems that
this hack doesn't work with link-time optimizations in compilers
as it's not C99/C11 compliant.

Fixes:
http://www.mail-archive.com/xz-devel@tukaani.org/msg00279.html

7 years agoUpdate THANKS.
Lasse Collin [Mon, 24 Oct 2016 15:53:25 +0000 (18:53 +0300)]
Update THANKS.

7 years agotuklib_cpucores: Add support for sched_getaffinity().
Lasse Collin [Mon, 24 Oct 2016 15:51:36 +0000 (18:51 +0300)]
tuklib_cpucores: Add support for sched_getaffinity().

It's available in glibc (GNU/Linux, GNU/kFreeBSD). It's better
than sysconf(_SC_NPROCESSORS_ONLN) because sched_getaffinity()
gives the number of cores available to the process instead of
the total number of cores online.

As a side effect, this commit fixes a bug on GNU/kFreeBSD where
configure would detect the FreeBSD-specific cpuset_getaffinity()
but it wouldn't actually work because on GNU/kFreeBSD it requires
using -lfreebsd-glue when linking. Now the glibc-specific function
will be used instead.

Thanks to Sebastian Andrzej Siewior for the original patch
and testing.

7 years agoxz: Fix copying of timestamps on Windows.
Lasse Collin [Thu, 30 Jun 2016 17:27:36 +0000 (20:27 +0300)]
xz: Fix copying of timestamps on Windows.

xz used to call utime() on Windows, but its result gets lost
on close(). Using _futime() seems to work.

Thanks to Martok for reporting the bug:
http://www.mail-archive.com/xz-devel@tukaani.org/msg00261.html