]> git.ipfire.org Git - thirdparty/xz.git/log
thirdparty/xz.git
5 years agoxz man page: Change \- (minus) to \(en (en-dash) for a numeric range.
Lasse Collin [Sun, 12 Jul 2020 20:10:03 +0000 (23:10 +0300)] 
xz man page: Change \- (minus) to \(en (en-dash) for a numeric range.

Docs of ancient troff/nroff mention \(em (em-dash) but not \(en
and \- was used for both minus and en-dash. I don't know how
portable \(en is nowadays but it can be changed back if someone
complains. At least GNU groff and OpenBSD's mandoc support it.

Thanks to Bjarni Ingi Gislason for the patch.

5 years agoWindows: Fix building of resource files when config.h isn't used.
Lasse Collin [Sun, 12 Jul 2020 17:46:24 +0000 (20:46 +0300)] 
Windows: Fix building of resource files when config.h isn't used.

Now CMake + Visual Studio works for building liblzma.dll.

Thanks to Markus Rickert.

5 years agosrc/scripts/xzgrep.1: Filenames to xzgrep are optional.
Lasse Collin [Mon, 6 Apr 2020 16:31:50 +0000 (19:31 +0300)] 
src/scripts/xzgrep.1: Filenames to xzgrep are optional.

xzgrep --help was correct already.

5 years agosrc/script/xzgrep.1: Remove superfluous '.RB'
Bjarni Ingi Gislason [Thu, 26 Mar 2020 22:17:31 +0000 (22:17 +0000)] 
src/script/xzgrep.1: Remove superfluous '.RB'

Output is from: test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z

  [ "test-groff" is a developmental version of "groff" ]

Input file is ./src/scripts/xzgrep.1

<src/scripts/xzgrep.1>:20 (macro RB): only 1 argument, but more are expected
<src/scripts/xzgrep.1>:23 (macro RB): only 1 argument, but more are expected
<src/scripts/xzgrep.1>:26 (macro RB): only 1 argument, but more are expected
<src/scripts/xzgrep.1>:29 (macro RB): only 1 argument, but more are expected
<src/scripts/xzgrep.1>:32 (macro RB): only 1 argument, but more are expected

 "abc..." does not mean the same as "abc ...".

  The output from nroff and troff is unchanged except for the space
between "file" and "...".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
5 years agoxzgrep.1: Delete superfluous '.PP'
Bjarni Ingi Gislason [Mon, 30 Mar 2020 21:56:36 +0000 (21:56 +0000)] 
xzgrep.1: Delete superfluous '.PP'

Summary:

mandoc -T lint xzgrep.1 :
mandoc: xzgrep.1:79:2: WARNING: skipping paragraph macro: PP empty

  There is no change in the output of "nroff" and "troff".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
5 years agosrc/xz/xz.1: Correct misused two-fonts macros
Bjarni Ingi Gislason [Thu, 26 Mar 2020 21:16:18 +0000 (21:16 +0000)] 
src/xz/xz.1: Correct misused two-fonts macros

Output is from: test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z

  [ "test-groff" is a developmental version of "groff" ]

Input file is ./src/xz/xz.1

<src/xz/xz.1>:408 (macro BR): only 1 argument, but more are expected
<src/xz/xz.1>:1009 (macro BR): only 1 argument, but more are expected
<src/xz/xz.1>:1743 (macro BR): only 1 argument, but more are expected
<src/xz/xz.1>:1920 (macro BR): only 1 argument, but more are expected
<src/xz/xz.1>:2213 (macro BR): only 1 argument, but more are expected

  Output from nroff and troff is unchanged, except for a font change of a
full stop (.).

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
5 years agoTypo fixes from fossies.org.
Lasse Collin [Mon, 23 Mar 2020 16:07:50 +0000 (18:07 +0200)] 
Typo fixes from fossies.org.

https://fossies.org/linux/misc/xz-5.2.5.tar.xz/codespell.html

5 years agoUpdate NEWS for 5.2.5.
Lasse Collin [Tue, 17 Mar 2020 14:24:28 +0000 (16:24 +0200)] 
Update NEWS for 5.2.5.

5 years agoREADME: Update outdated sections.
Lasse Collin [Mon, 16 Mar 2020 18:01:37 +0000 (20:01 +0200)] 
README: Update outdated sections.

5 years agoREADME: Mention that man pages can be translated.
Lasse Collin [Mon, 16 Mar 2020 17:39:45 +0000 (19:39 +0200)] 
README: Mention that man pages can be translated.

5 years agoUpdate INSTALL.generic from Automake 1.16.1.
Lasse Collin [Mon, 16 Mar 2020 14:43:29 +0000 (16:43 +0200)] 
Update INSTALL.generic from Automake 1.16.1.

5 years agoUpdate INSTALL for Windows and DOS and add preliminary info for z/OS.
Lasse Collin [Sun, 15 Mar 2020 13:27:22 +0000 (15:27 +0200)] 
Update INSTALL for Windows and DOS and add preliminary info for z/OS.

5 years agoBuild: Update m4/ax_pthread.m4 from Autoconf Archive (again).
Lasse Collin [Sun, 15 Mar 2020 13:26:20 +0000 (15:26 +0200)] 
Build: Update m4/ax_pthread.m4 from Autoconf Archive (again).

5 years agoxz: Never use thousand separators in DJGPP builds.
Lasse Collin [Wed, 11 Mar 2020 19:15:35 +0000 (21:15 +0200)] 
xz: Never use thousand separators in DJGPP builds.

DJGPP 2.05 added support for thousands separators but it's
broken at least under WinXP with Finnish locale that uses
a non-breaking space as the thousands separator. Workaround
by disabling thousands separators for DJGPP builds.

5 years agoDOS: Update dos/Makefile for DJGPP 2.05.
Lasse Collin [Wed, 11 Mar 2020 17:38:08 +0000 (19:38 +0200)] 
DOS: Update dos/Makefile for DJGPP 2.05.

It doesn't need -fgnu89-inline like 2.04beta did.

5 years agoDOS: Update instructions in dos/INSTALL.txt.
Lasse Collin [Wed, 11 Mar 2020 17:36:07 +0000 (19:36 +0200)] 
DOS: Update instructions in dos/INSTALL.txt.

5 years agoDOS: Update config.h.
Lasse Collin [Wed, 11 Mar 2020 15:58:51 +0000 (17:58 +0200)] 
DOS: Update config.h.

The added defines assume GCC >= 4.8.

5 years agoliblzma: Fix a comment and RC_SYMBOLS_MAX.
Lasse Collin [Mon, 2 Mar 2020 11:54:33 +0000 (13:54 +0200)] 
liblzma: Fix a comment and RC_SYMBOLS_MAX.

The comment didn't match the value of RC_SYMBOLS_MAX and the value
itself was slightly larger than actually needed. The only harm
about this was that memory usage was a few bytes larger.

5 years agoBuild: Make CMake build fail if tuklib_cpucores or tuklib_physmem fails.
Lasse Collin [Thu, 27 Feb 2020 18:58:52 +0000 (20:58 +0200)] 
Build: Make CMake build fail if tuklib_cpucores or tuklib_physmem fails.

5 years agoBuild: Add support for --no-po4a option to autogen.sh.
Lasse Collin [Thu, 27 Feb 2020 18:24:27 +0000 (20:24 +0200)] 
Build: Add support for --no-po4a option to autogen.sh.

Normally, if po4a isn't available, autogen.sh will return
with non-zero exit status. The option --no-po4a can be useful
when one knows that po4a isn't available but wants autogen.sh
to still return with zero exit status.

5 years agoUpdate THANKS.
Lasse Collin [Tue, 25 Feb 2020 19:35:14 +0000 (21:35 +0200)] 
Update THANKS.

5 years agoBuild: Fix bugs in the CMake files.
Lasse Collin [Tue, 25 Feb 2020 18:42:31 +0000 (20:42 +0200)] 
Build: Fix bugs in the CMake files.

Seems that the phrase "add more quotes" from sh/bash scripting
applies to CMake as well. E.g. passing an unquoted list ${FOO}
to a function that expects one argument results in only the
first element of the list being passed as an argument and
the rest get ignored. Adding quotes helps ("${FOO}").

list(INSERT ...) is weird. Inserting an empty string to an empty
variable results in empty list, but inserting it to a non-empty
variable does insert an empty element to the list.

Since INSERT requires at least one element,
"${CMAKE_THREAD_LIBS_INIT}" needs to be quoted in CMakeLists.txt.
It might result in an empty element in the list. It seems to not
matter as empty elements consistently get ignored in that variable.
In fact, calling cmake_check_push_state() and cmake_check_pop_state()
will strip the empty elements from CMAKE_REQUIRED_LIBRARIES!

In addition to quoting fixes, this fixes checks for the cache
variables in tuklib_cpucores.cmake and tuklib_physmem.cmake.

Thanks to Martin Matuška for testing and reporting the problems.
These fixes aren't tested yet but hopefully they soon will be.

5 years agoBuild: Add very limited experimental CMake support.
Lasse Collin [Mon, 24 Feb 2020 21:38:16 +0000 (23:38 +0200)] 
Build: Add very limited experimental CMake support.

This does *NOT* replace the Autotools-based build system in
the foreseeable future. See the comment in the beginning
of CMakeLists.txt.

So far this has been tested only on GNU/Linux but I commit
it anyway to make it easier for others to test. Since I
haven't played much with CMake before, it's likely that
there are things that have been done in a silly or wrong
way and need to be fixed.

5 years agoUpdate m4/.gitignore.
Lasse Collin [Mon, 24 Feb 2020 21:37:07 +0000 (23:37 +0200)] 
Update m4/.gitignore.

5 years agotuklib: Omit an unneeded <sys/types.h> from a tests.
Lasse Collin [Mon, 24 Feb 2020 21:29:35 +0000 (23:29 +0200)] 
tuklib: Omit an unneeded <sys/types.h> from a tests.

tuklib_cpucores.c and tuklib_physmem.c don't include <sys/types.h>
even via other files in this package, so clearly that header isn't
needed in the tests either (no one has reported build problems due
to a missing header in a .c file).

5 years agoliblzma: Remove unneeded <sys/types.h> from fastpos_tablegen.c.
Lasse Collin [Mon, 24 Feb 2020 21:01:00 +0000 (23:01 +0200)] 
liblzma: Remove unneeded <sys/types.h> from fastpos_tablegen.c.

This file only generates fastpos_table.c.
It isn't built as a part of liblzma.

5 years agoUse defined(__GNUC__) before __GNUC__ in preprocessor lines.
Lasse Collin [Sat, 22 Feb 2020 12:15:07 +0000 (14:15 +0200)] 
Use defined(__GNUC__) before __GNUC__ in preprocessor lines.

This should silence the equivalent of -Wundef in compilers that
don't define __GNUC__.

5 years agoliblzma: Add more uses of lzma_memcmplen() to the normal mode of LZMA.
Lasse Collin [Fri, 21 Feb 2020 15:40:02 +0000 (17:40 +0200)] 
liblzma: Add more uses of lzma_memcmplen() to the normal mode of LZMA.

This gives a tiny encoder speed improvement. This could have been done
in 2014 after the commit 544aaa3d13554e8640f9caf7db717a96360ec0f6 but
it was forgotten.

5 years agoBuild: Add visibility.m4 from gnulib.
Lasse Collin [Fri, 21 Feb 2020 15:01:15 +0000 (17:01 +0200)] 
Build: Add visibility.m4 from gnulib.

Appears that this file used to get included as a side effect of
gettext. After the change to gettext version requirements this file
no longer got copied to the package and so the build was broken.

5 years agoxz: Silence a warning when sig_atomic_t is long int.
Lasse Collin [Fri, 21 Feb 2020 14:10:44 +0000 (16:10 +0200)] 
xz: Silence a warning when sig_atomic_t is long int.

It can be true at least on z/OS.

5 years agoxz: Avoid unneeded access of a volatile variable.
Lasse Collin [Fri, 21 Feb 2020 13:59:26 +0000 (15:59 +0200)] 
xz: Avoid unneeded access of a volatile variable.

5 years agotuklib_integer.m4: Optimize the check order.
Lasse Collin [Thu, 20 Feb 2020 23:24:18 +0000 (01:24 +0200)] 
tuklib_integer.m4: Optimize the check order.

The __builtin byteswapping is the preferred one so check for it first.

5 years agotuklib_exit: Add missing header.
Lasse Collin [Thu, 20 Feb 2020 16:54:04 +0000 (18:54 +0200)] 
tuklib_exit: Add missing header.

strerror() needs <string.h> which happened to be included via
tuklib_common.h -> tuklib_config.h -> sysdefs.h if HAVE_CONFIG_H
was defined. This wasn't tested without config.h before so it
had worked fine.

5 years agoRevert the previous commit and add a comment.
Lasse Collin [Tue, 18 Feb 2020 17:12:35 +0000 (19:12 +0200)] 
Revert the previous commit and add a comment.

The previous commit broke crc32_tablegen.c.

If the whole package is built without config.h (with defines
set on the compiler command line) this should still work fine
as long as these headers conform to C99 well enough.

5 years agoDo not check for HAVE_CONFIG_H in tuklib_config.h.
Lasse Collin [Mon, 17 Feb 2020 21:37:20 +0000 (23:37 +0200)] 
Do not check for HAVE_CONFIG_H in tuklib_config.h.

In XZ Utils sysdefs.h takes care of it and the required headers.

5 years agosysdefs.h: Omit the conditionals around string.h and limits.h.
Lasse Collin [Sun, 16 Feb 2020 09:18:28 +0000 (11:18 +0200)] 
sysdefs.h: Omit the conditionals around string.h and limits.h.

string.h is used unconditionally elsewhere in the project and
configure has always stopped if limits.h is missing, so these
headers must have been always available even on the weirdest
systems.

5 years agoBuild: Bump Autoconf and Libtool version requirements.
Lasse Collin [Sat, 15 Feb 2020 13:07:11 +0000 (15:07 +0200)] 
Build: Bump Autoconf and Libtool version requirements.

There is no specific reason for this other than blocking
the most ancient versions. These are still old:

Autoconf 2.69 (2012)
Automake 1.12 (2012)
gettext 0.19.6 (2015)
Libtool 2.4 (2010)

5 years agoBuild: Use AM_GNU_GETTEXT_REQUIRE_VERSION and require 0.19.6.
Lasse Collin [Sat, 15 Feb 2020 01:08:32 +0000 (03:08 +0200)] 
Build: Use AM_GNU_GETTEXT_REQUIRE_VERSION and require 0.19.6.

This bumps the version requirement from 0.19 (from 2014) to
0.19.6 (2015).

Using only the old AM_GNU_GETTEXT_VERSION results in old
gettext infrastructure being placed in the package. By using
both macros we get the latest gettext files while the other
programs in the Autotools family can still see the old macro.

5 years agoTranslations: Add German translation of the man pages.
Lasse Collin [Fri, 14 Feb 2020 18:42:06 +0000 (20:42 +0200)] 
Translations: Add German translation of the man pages.

Thanks to Mario Blättermann.

5 years agoBuild: Add support for translated man pages using po4a.
Lasse Collin [Fri, 7 Feb 2020 13:32:21 +0000 (15:32 +0200)] 
Build: Add support for translated man pages using po4a.

The dependency on po4a is optional. It's never required to install
the translated man pages when xz is built from a release tarball.
If po4a is missing when building from xz.git, the translated man
pages won't be generated but otherwise the build will work normally.

The translations are only updated automatically by autogen.sh and
by "make mydist". This makes it easy to keep po4a as an optional
dependency and ensures that I won't forget to put updated
translations to a release tarball.

The translated man pages aren't installed if --disable-nls is used.

The installation of translated man pages abuses Automake internals
by calling "install-man" with redefined dist_man_MANS and man_MANS.
This makes the hairy script code slightly less hairy. If it breaks
some day, this code needs to be fixed; don't blame Automake developers.

Also, this adds more quotes to the existing shell script code in
the Makefile.am "-hook"s.

5 years agoUpdate THANKS.
Lasse Collin [Thu, 6 Feb 2020 15:31:38 +0000 (17:31 +0200)] 
Update THANKS.

5 years agoUpdate tests/.gitignore.
Lasse Collin [Wed, 5 Feb 2020 20:35:06 +0000 (22:35 +0200)] 
Update tests/.gitignore.

5 years agoUpdate m4/.gitignore.
Lasse Collin [Wed, 5 Feb 2020 20:28:51 +0000 (22:28 +0200)] 
Update m4/.gitignore.

5 years agoUpdate THANKS.
Lasse Collin [Wed, 5 Feb 2020 18:47:38 +0000 (20:47 +0200)] 
Update THANKS.

5 years agoxz: Make it a fatal error if enabling the sandbox fails.
Lasse Collin [Wed, 5 Feb 2020 18:40:14 +0000 (20:40 +0200)] 
xz: Make it a fatal error if enabling the sandbox fails.

Perhaps it's too drastic but on the other hand it will let me
learn about possible problems if people report the errors.
This won't be backported to the v5.2 branch.

5 years agoxz: Comment out annoying sandboxing messages.
Lasse Collin [Wed, 5 Feb 2020 18:33:50 +0000 (20:33 +0200)] 
xz: Comment out annoying sandboxing messages.

5 years agoBuild: Workaround a POSIX shell detection problem on Solaris.
Lasse Collin [Wed, 5 Feb 2020 17:33:37 +0000 (19:33 +0200)] 
Build: Workaround a POSIX shell detection problem on Solaris.

I don't know if the problem is in gnulib's gl_POSIX_SHELL macro
or if xzgrep does something that isn't in POSIX. The workaround
adds a special case for Solaris: if /usr/xpg4/bin/sh exists and
gl_cv_posix_shell wasn't overriden on the configure command line,
use that shell for xzgrep and other scripts. That shell is known
to work and exists on most Solaris systems.

5 years agoBuild: Update m4/ax_pthread.m4 from Autoconf Archive.
Lasse Collin [Mon, 3 Feb 2020 20:03:50 +0000 (22:03 +0200)] 
Build: Update m4/ax_pthread.m4 from Autoconf Archive.

5 years agoxz: Limit --memlimit-compress to at most 4020 MiB for 32-bit xz.
Lasse Collin [Sat, 1 Feb 2020 17:56:18 +0000 (19:56 +0200)] 
xz: Limit --memlimit-compress to at most 4020 MiB for 32-bit xz.

See the code comment for reasoning. It's far from perfect but
hopefully good enough for certain cases while hopefully doing
nothing bad in other situations.

At presets -5 ... -9, 4020 MiB vs. 4096 MiB makes no difference
on how xz scales down the number of threads.

The limit has to be a few MiB below 4096 MiB because otherwise
things like "xz --lzma2=dict=500MiB" won't scale down the dict
size enough and xz cannot allocate enough memory. With
"ulimit -v $((4096 * 1024))" on x86-64, the limit in xz had
to be no more than 4085 MiB. Some safety margin is good though.

This is hack but it should be useful when running 32-bit xz on
a 64-bit kernel that gives full 4 GiB address space to xz.
Hopefully this is enough to solve this:

https://bugzilla.redhat.com/show_bug.cgi?id=1196786

FreeBSD has a patch that limits the result in tuklib_physmem()
to SIZE_MAX on 32-bit systems. While I think it's not the way
to do it, the results on --memlimit-compress have been good. This
commit should achieve practically identical results for compression
while leaving decompression and tuklib_physmem() and thus
lzma_physmem() unaffected.

5 years agoxz: Set the --flush-timeout deadline when the first input byte arrives.
Lasse Collin [Sun, 26 Jan 2020 18:53:25 +0000 (20:53 +0200)] 
xz: Set the --flush-timeout deadline when the first input byte arrives.

xz --flush-timeout=2000, old version:

  1. xz is started. The next flush will happen after two seconds.
  2. No input for one second.
  3. A burst of a few kilobytes of input.
  4. No input for one second.
  5. Two seconds have passed and flushing starts.

The first second counted towards the flush-timeout even though
there was no pending data. This can cause flushing to occur more
often than needed.

xz --flush-timeout=2000, after this commit:

  1. xz is started.
  2. No input for one second.
  3. A burst of a few kilobytes of input. The next flush will
     happen after two seconds counted from the time when the
     first bytes of the burst were read.
  4. No input for one second.
  5. No input for another second.
  6. Two seconds have passed and flushing starts.

5 years agoxz: Move flush_needed from mytime.h to file_pair struct in file_io.h.
Lasse Collin [Sun, 26 Jan 2020 18:19:19 +0000 (20:19 +0200)] 
xz: Move flush_needed from mytime.h to file_pair struct in file_io.h.

5 years agoxz: coder.c: Make writing output a separate function.
Lasse Collin [Sun, 26 Jan 2020 12:49:22 +0000 (14:49 +0200)] 
xz: coder.c: Make writing output a separate function.

The same code sequence repeats so it's nicer as a separate function.
Note that in one case there was no test for opt_mode != MODE_TEST,
but that was only because that condition would always be true, so
this commit doesn't change the behavior there.

5 years agoxz: Fix semi-busy-waiting in xz --flush-timeout.
Lasse Collin [Sun, 26 Jan 2020 12:13:42 +0000 (14:13 +0200)] 
xz: Fix semi-busy-waiting in xz --flush-timeout.

When input blocked, xz --flush-timeout=1 would wake up every
millisecond and initiate flushing which would have nothing to
flush and thus would just waste CPU time. The fix disables the
timeout when no input has been seen since the previous flush.

5 years agoxz: Refactor io_read() a bit.
Lasse Collin [Sun, 26 Jan 2020 11:47:31 +0000 (13:47 +0200)] 
xz: Refactor io_read() a bit.

5 years agoxz: Update a comment in file_io.h.
Lasse Collin [Sun, 26 Jan 2020 11:37:08 +0000 (13:37 +0200)] 
xz: Update a comment in file_io.h.

5 years agoxz: Move the setting of flush_needed in file_io.c to a nicer location.
Lasse Collin [Sun, 26 Jan 2020 11:27:51 +0000 (13:27 +0200)] 
xz: Move the setting of flush_needed in file_io.c to a nicer location.

5 years agoUse $(LIB_FUZZING_ENGINE) in tests/ossfuzz/Makefile.
Lasse Collin [Sun, 19 Jan 2020 19:54:33 +0000 (21:54 +0200)] 
Use $(LIB_FUZZING_ENGINE) in tests/ossfuzz/Makefile.

https://github.com/google/oss-fuzz/pull/3219#issuecomment-573751048

Thanks to Bhargava Shastry for sending the patch.

5 years agoRename unaligned_read32ne to read32ne, and similarly for the others.
Lasse Collin [Mon, 30 Dec 2019 22:41:28 +0000 (00:41 +0200)] 
Rename unaligned_read32ne to read32ne, and similarly for the others.

5 years agoRename read32ne to aligned_read32ne, and similarly for the others.
Lasse Collin [Mon, 30 Dec 2019 22:29:48 +0000 (00:29 +0200)] 
Rename read32ne to aligned_read32ne, and similarly for the others.

Using the aligned methods requires more care to ensure that
the address really is aligned, so it's nicer if the aligned
methods are prefixed. The next commit will remove the unaligned_
prefix from the unaligned methods which in liblzma are used in
more places than the aligned ones.

5 years agoRevise tuklib_integer.h and .m4.
Lasse Collin [Mon, 30 Dec 2019 22:18:24 +0000 (00:18 +0200)] 
Revise tuklib_integer.h and .m4.

Add a configure option --enable-unsafe-type-punning to get the
old non-conforming memory access methods. It can be useful with
old compilers or in some other less typical situations but
shouldn't normally be used.

Omit the packed struct trick for unaligned access. While it's
best in some cases, this is simpler. If the memcpy trick doesn't
work, one can request unsafe type punning from configure.

Because CRC32/CRC64 code needs fast aligned reads, if no very
safe way to do it is found, type punning is used as a fallback.
This sucks but since it currently works in practice, it seems to
be the least bad option. It's never needed with GCC >= 4.7 or
Clang >= 3.6 since these support __builtin_assume_aligned and
thus fast aligned access can be done with the memcpy trick.

Other things:
  - Support GCC/Clang __builtin_bswapXX
  - Cleaner bswap fallback macros
  - Minor cleanups

5 years agoTests: Hopefully fix test_check.c to work on EBCDIC systems.
Lasse Collin [Sun, 29 Dec 2019 20:51:58 +0000 (22:51 +0200)] 
Tests: Hopefully fix test_check.c to work on EBCDIC systems.

Thanks to Daniel Richard G.

5 years agoScripts: Put /usr/xpg4/bin to the beginning of PATH on Solaris.
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.

6 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.

6 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.

6 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.

6 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.

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

6 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.

6 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.

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

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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).

6 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.

6 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.

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

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

Thanks to Bruce Stark.

6 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().

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

6 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

6 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.

6 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.

6 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.

6 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.

6 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.

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

6 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.