778 Commits

Author SHA1 Message Date
Jim Meyering
c8e167e3e8 maint: update --version copyright dates
* gunzip.in, gzexe.in, gzip.c, zcat.in, zcmp.in, zdiff.in, zforce.in,
zgrep.in, zless.in, zmore.in, znew.in: Also update the --version copyright
dates (while updated by update-copyright, those didn't satisfy syntax-check)
by running this:

  grep -l 2025-2026 *.in gzip.c|xargs perl -pi -e 's/2025-2026/2026/'
2026-01-02 17:27:19 -08:00
Jim Meyering
50463e0899 maint: update copyright dates 2026-01-02 17:10:47 -08:00
Jim Meyering
4b82e75309 build: update gnulib to latest; and bootstrap 2026-01-02 17:09:55 -08:00
Jim Meyering
74ff17967a build: update gnulib to latest 2025-11-09 18:46:15 -08:00
Paul Eggert
da644c731c build: update gnulib submodule to latest 2025-09-11 12:53:06 -07:00
Paul Eggert
131964d8ff gzip: report "-Inf%" for negative infinity
* tests/list: Test for this.
* util.c (display_ratio):
Say "-%Inf%" if the compression ratio is negative infinity.
From a suggestion by Mark Adler <https://bugs.gnu.org/79414#13>.
2025-09-09 11:35:17 -07:00
Paul Eggert
386f4fa111 gzip: fix NEWS
* NEWS: Fix as per <https://bugs.gnu.org/78799#38>.
2025-06-17 08:51:33 -07:00
Paul Eggert
7bd69d3e7a maint: add NEWS entry re PKZIP fixes 2025-06-16 12:54:51 -07:00
Paul Eggert
a5f00e1bd5 gzip: don’t assume EOF == -1
Although EOF == -1 on all known platforms, POSIX and C don’t
guarantee it.  Fix code that silently assumes this.
* deflate.c (lm_init, fill_window):
* gzip.c (get_method):
* util.c (fill_inbuf):
Don’t assume EOF == -1, or that converting EOF to unsigned
and back to int yields -1.  Instead, statically check
EOF-related assumptions.
* deflate.c (fill_window): Check for more < EOF, not more != EOF.
2025-06-16 12:49:57 -07:00
Paul Eggert
9b6ce179fa unzip: add regression test for recent fixes
* tests/unzip-valid: New test, taken from Bug#78799.
* tests/Makefile.am (TESTS): Add it.
2025-06-16 12:49:57 -07:00
Paul Eggert
fd5b3c6b20 unzip: use GNU style in newly-added code
* unzip.c (unzip): Use GNU style.
2025-06-16 12:49:57 -07:00
Mark Adler
a1e8e0b981 zip: correctly handle PKZIP data descriptors
* unzip.c (DATSIG, L8): New macros.
(unzip): Previously only one of the four possible data descriptors was
handled. Check for all four when validating the uncompressed
data with the CRC and length in the data descriptor. This also now
checks the full eight-byte uncompressed length for zip files.
2025-06-16 12:49:57 -07:00
Paul Eggert
575250263c unzip: refactor loop that never loops
* unzip.c (bad_zipfile): New static function,
with most of the old contents of check_zipfile.
This is clearer than the trick of having a loop that never loops.
(check_zipfile): Use it.
2025-06-16 12:49:57 -07:00
Paul Eggert
29cad37003 gzip: get_method 2nd arg is bool
* gzip.c (get_method): Use bool for boolean.
2025-06-16 12:49:57 -07:00
Mark Adler
886d2c6965 zip: correctly handle PKZIP signatures and the local header
This fixes bugs in the lack of detection of spanning signatures,
lack of detection of empty zip files, checking the compression
method, failure to skip over the file name and extra field in the
SMALL_MEM case, failure to get the CRC and uncompressed length in
the SMALL_MEM case, failure to check for invalid combinations of
header information, the lack of detection of a Zip64 entry, and
a possible decompression of a zip entry after a gzip member.
* gzip.c (get_method): New arg FIRST.  All callers changed.
* gzip.h (PKZIP_MAGIC): Now just the two-byte magic header.
* unzip.c (SPNSIG, ONESIG, Z64SIG, ENDSIG): New macros.
(RAND_HEAD_LEN, decrypt): Remove.  All uses removed.
(orig_crc, orig_len): New static vars.
(check_zipfile, unzip): Handle PKZIP signatures and the local header.
2025-06-16 12:49:57 -07:00
Paul Eggert
6264387434 maint: use GNU style in lines just untabbed 2025-06-16 12:49:57 -07:00
Mark Adler
c651ce70ae maint: replace tabs in the source code with spaces 2025-06-16 12:49:57 -07:00
Paul Eggert
c76affb455 gzip: fix s390x build failure
Problem reported by Jakub Martisko <https://bugs.gnu.org/78618>.
* dfltcc.c: Include errno.h.
2025-05-30 12:31:37 -07:00
Paul Eggert
b1de0e782a gzip: fix another uninitialized read
This can occur if you define DYNALLOC.
Problem reported by Mohamed Maatallah <https://bugs.gnu.org/78639#13>.
* gzip.c (get_method): Don’t memcmp more bytes than were read.
Also, no need to do two memcmp’s now, or to check inptr.
2025-05-30 12:26:42 -07:00
Paul Eggert
c5e789971d gzip: fix uninitialized read
Problem reported by Mohamed Maatallah <https://bugs.gnu.org/78639>.
* unzip.c (check_zipfile):
Don’t read past end of initialized data in the input buffer.
2025-05-29 23:07:48 -07:00
Paul Eggert
e77940b44f tests: port to Busybox od
Problem reported by Xinjian Ma (Bug#78084).
* tests/reference: Skip this test if od does not support -An -tx1
as POSIX requires. Also, omit an unnecessary use of tr, since
the $(...) already does that.
2025-04-27 13:28:49 -07:00
Jim Meyering
a6924a2a20 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2025-04-09 20:48:10 -07:00
Jim Meyering
fbc4883eb9 version 1.14
* NEWS: Record release date.
v1.14
2025-04-09 20:46:24 -07:00
Jim Meyering
f3e440f1c9 build: avoid test failure on systems lacking "more"
On such systems, treat "more" as optional, just as we treat "less".
If the primary program is not available, do not install zmore.
Reported by Bruno Haible in http://debbugs.gnu.org/77563 and noticed
on a 2025 x86_64 GNU/Hurd system.
* configure.ac: Check for more/MORE just like we do for less/LESS.
* tests/Makefile.am: Use the new variables.
* NEWS: Mention it.
2025-04-06 15:59:37 -07:00
Jim Meyering
e5491fbcc7 maint: fix typos spotted by codespell
Induced by running this:
  printf '%s\n' Tye tye Ned bu nd > w
  codespell -w --summary --count -Iw $(git ls-files|grep -v gnulib)
Summary:
cvignore      1
declration    1
endianess     1
instad        1
intall        2
ouput         1
reenabled     1
repoducible   1
uncompressible1
* ChangeLog-2007: Fix typos.
* NEWS: Likewise.
* inflate.c: Likewise.
* sample/sub.c: Likewise.
* tests/reproducible: Likewise.
Since the above changed NEWS, I must also do this:
* cfg.mk (old_NEWS_hash): Update, to reflect recent NEWS correction.
(exclude_file_name_regexp--sc_codespell): Ignore THANKS.
(codespell_ignore_words_list): Exempt two false-positives.
2025-03-27 21:30:42 -07:00
Paul Eggert
02cde43286 Ignore GZIP envvar except for innocuous flags
This is slimmed down from the originally proposed patch, which
ignored GZIP entirely.  Thanks to Lasse Collin for thoughtful comments.
* gzip.c (ENV_OPTION): Remove.  All uses removed.
(main): Parse GZIP contents with error diagnostics disabled,
and simply ignore invalid contents.  Ignore all options
except -1 thru -9, --rsyncable, --synchronous.  Remove
unnecessary longind local; all uses removed.
* tests/gzip-env (GZIP): Adjust to match current behavior.
Also test --rsyncable, --synchronous.
2025-02-19 22:38:17 -08:00
Paul Eggert
0b1448fb14 Fix THANKS typo 2025-02-10 22:44:45 -08:00
Paul Eggert
6b65e654a7 gzip: use pclmul if available
Suggested by Sam Russell (Bug#74192).
* bootstrap.conf (gnulib_modules): Depend on crc-x86_64, not just crc.
* NEWS, THANKS, lib/.gitignore, m4/.gitignore:
Update accordingly.
2025-02-10 22:36:17 -08:00
Paul Eggert
c971312eca maint: update .gitignore
* m4/.gitignore: Add init-package-version.m4.
2025-02-10 22:36:17 -08:00
Jim Meyering
ccb3065b57 maint: continue writing base64-encoded checksums to announcement
* cfg.mk (announce_gen_args): Set to --cksum-checksums.
2025-02-08 20:09:04 -08:00
Paul Eggert
f182f808d4 gzip: prefer static_assert to verify
* bootstrap.conf (gnulib_modules): Replace verify with assert-h.
* deflate.c: Do not include verify.h.
Use C23-style static_assert rather than verify.
2025-02-06 10:02:42 -08:00
Paul Eggert
23ddd95f3e gzip: better fix for s390 buffer flushes
* dfltcc.c (dfltcc_inflate): The previous patch was incorrect, as
fill_inbuf (0) will not call flush_outbuf which is needed here.
Problem and fix reported by Eduard Stefes in
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=75924#13>.
Although this patch causes the hufts test to fail, that might be
due to a different bug in the s390 code, so let’s leave that test
alone for now.
2025-02-06 10:02:42 -08:00
Jim Meyering
c8bb80baf3 maint: fix mistake in preceding change
* bootstrap.conf (gnulib_modules): The deprecated realloc-gnu module
cannot be renamed to realloc-gnu-h (which doesn't exist), but rather
to realloc-posix. Spotted by Collin Funk.
2025-02-02 20:12:51 -08:00
Jim Meyering
c5abc7e850 build: update gnulib to latest; and update bootstrap 2025-02-01 21:23:32 -08:00
Jim Meyering
1d55ec32e8 maint: reflect gnulib module renamings
* bootstrap.conf: Some gnulib modules are now deprecated in favor of
new names with a "-h" suffix.  Induce this change with the following:
  re='inttypes|realloc-gnu|sys_stat'
  perl -pi -e 's{^('"$re"')$}{$1-h}' bootstrap.conf
2025-02-01 16:13:30 -08:00
Paul Eggert
c7e305df59 gzip: fix problem with s390 buffer flushes
Problem reported by Eduard Stefes <https://bugs.gnu.org/74651>.
* dfltcc.c (dfltcc_deflate): Flush output buffer if premature EOF.
2025-01-29 10:53:34 -08:00
Lasse Collin
a150751196 tests: synchronous: new test
* tests/synchronous: Test that --synchronous works. This
failed with musl 1.2.5 before the Gnulib commit 0fb185b7cd5e
("fcntl-h: port better to musl on GNU/Linux").
* tests/Makefile.am (TESTS): Add it.
2025-01-10 10:18:02 -08:00
Paul Eggert
ae9610d138 maint: update .gitignore
* lib/.gitignore, m4/.gitignore: Update to match current Gnulib.
2025-01-10 10:18:02 -08:00
Paul Eggert
4c35b3e890 build: update gnulib submodule to latest 2025-01-10 10:18:02 -08:00
Jim Meyering
a36ba883e7 build: update gnulib to latest 2025-01-03 09:36:50 -08:00
Jim Meyering
7fb7d879d2 maint: update --version copyright dates
* gunzip.in, gzexe.in, gzip.c, zcat.in, zcmp.in, zdiff.in, zforce.in,
zgrep.in, zless.in, zmore.in, znew.in: Also update the --version copyright
dates (while updated by update-copyright, those didn't satisfy syntax-check)
by running this:

grep -l 2024-2025 *.in gzip.c|xargs perl -pi -e 's/2024-2025/2025/'
2025-01-03 09:34:56 -08:00
Jim Meyering
98db945a34 maint: update all copyright dates via "make update-copyright" 2025-01-03 09:33:55 -08:00
Jim Meyering
22827581c2 gnulib: avoid the new gnulib-i18n module
* bootstrap.conf (avoided_gnulib_modules): New variable.
Use it to omit the gnulib-i18n module, since this package
is not internationalized.
2024-12-13 21:31:26 -08:00
Jim Meyering
0e23cd90dd build: update gnulib to latest; also update bootstrap 2024-12-13 21:31:14 -08:00
Sam Russell
46e9db301a maint: initialize MAINTAINERCLEANFILES
* lib/Makefile.am (MAINTAINERCLEANFILES): Initialize to empty.
Gnulib expects it to be set as it appends values to it, the recent
upgrade to lib/crc.c modifies this and building fails if it isn't
already set before gnulib.mk is included.
2024-11-02 19:13:39 -07:00
Simon Josefsson
b1c42e30a7 maint: Drop unused sample/makecrc.c. 2024-10-17 13:47:14 -07:00
Paul Eggert
602fa20438 maint: ‘type’ → ‘command -v’
POSIX says ‘type’ is an XSI extension, whereas ‘command -v’ is
part of the base.  Problem reported by Clarence “Sparr” Risher in
<https://bugs.gnu.org/73402>.
* gzexe.in, tests/help-version, zdiff.in, zgrep.in:
Use ‘command -v’, not ‘type’.
2024-09-22 00:07:11 -07:00
Collin Funk
bf0b38ae16 maint: update library names used by gnulib
* Makefile.am (gzip_LDADD): Update library names according to Gnulib
NEWS 2023-01-07.
2024-09-11 06:44:41 -07:00
Jim Meyering
9a15d2fcdd tests: reference: don't rely on od's -w option
* tests/reference: Don't rely on od's -w option.
Instead, use tr -d '\n' to join the output lines.
Reported by Bruno Haible in https://bugs.gnu.org/73140
2024-09-09 13:41:54 -07:00
Jim Meyering
d1fc732de1 maint: use gnulib's crc module in place of our own code
* bootstrap.conf (gnulib_modules): Add crc.
* util.c: Include "crc.h".
(crc_32_tab): Delete. No longer used.
(updcrc): Use gnulib's crc32_update.
(crc): Initialize the global to 0, not 0xffffffffL.
(setcrc, getcrc): Stop flipping bits. No longer needed.
* lib/.gitignore: Add crc.c and crc.h, and sort.
2024-09-09 00:19:29 -07:00