cosmopolitan/third_party/unzip
Justine Tunney 4778cd4d27
Fix bugs in termios library and cleanup code
This change fixes an issue with the tcflow() magic numbers that was
causing bash to freeze up on Linux. While auditing termios polyfills,
several other issues were identified with XNU/BSD compatibility.

Out of an abundance of caution this change undefines as much surface
area from libc/calls/struct/termios.h as possible, so that autoconf
scripts are less likely to detect non-POSIX teletypewriter APIs that
haven't been polyfilled by Cosmopolitan.

This is a *breaking change* for your static archives in /opt/cosmos if
you use the cosmocc toolchain. That's because this change disables the
ioctl() undiamonding trick for code outside the monorepo, specifically
because it'll lead to brittle ABI breakages like this. If you're using
the cosmocc toolchain, you'll need to rebuild libraries like ncurses,
readline, etc. Yes diamonds cause bloat. To work around that, consider
using tcgetwinsize() instead of ioctl(TIOCGWINSZ) since it'll help you
avoid pulling every single ioctl-related polyfill into the linkage.

The cosmocc script was specifying -DNDEBUG for some reason. It's fixed.
2023-06-14 19:30:52 -07:00
..
unix Work around Landlock output inode in compile.com 2022-08-09 07:55:44 -07:00
api.c Revert whitespace fixes to third_party (#501) 2022-07-21 21:46:07 -07:00
apihelp.c Add Info-ZIP unzip.com 2022-06-10 05:09:11 -07:00
consts.h Add Info-ZIP unzip.com 2022-06-10 05:09:11 -07:00
crc32.c Add Info-ZIP unzip.com 2022-06-10 05:09:11 -07:00
crc32.h Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
crypt.c Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
crypt.h Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
ebcdic.h Add Info-ZIP unzip.com 2022-06-10 05:09:11 -07:00
envargs.c Unbloat the build 2022-08-11 00:15:29 -07:00
explode.c Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
extract.c Fold LIBC_ALG into LIBC_MEM 2022-08-13 08:32:34 -07:00
fileio.c Simplify ftrace_hook() 2023-06-06 11:10:38 -07:00
globals.c Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
globals.h Add Info-ZIP unzip.com 2022-06-10 05:09:11 -07:00
inflate.c Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
inflate.h Add Info-ZIP unzip.com 2022-06-10 05:09:11 -07:00
LICENSE Add Info-ZIP unzip.com 2022-06-10 05:09:11 -07:00
list.c Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
match.c Revert whitespace fixes to third_party (#501) 2022-07-21 21:46:07 -07:00
process.c Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
README.cosmo Add Info-ZIP unzip.com 2022-06-10 05:09:11 -07:00
timezone.c Add Info-ZIP unzip.com 2022-06-10 05:09:11 -07:00
timezone.h Add Info-ZIP unzip.com 2022-06-10 05:09:11 -07:00
ttyio.c Fix bugs in termios library and cleanup code 2023-06-14 19:30:52 -07:00
ttyio.h Add Info-ZIP unzip.com 2022-06-10 05:09:11 -07:00
ubz2err.c Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
unix.c There must only be one strerror() 2023-05-10 15:34:13 -07:00
unreduce.c Add Info-ZIP unzip.com 2022-06-10 05:09:11 -07:00
unshrink.c Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
unxcfg.h Revert whitespace fixes to third_party (#501) 2022-07-21 21:46:07 -07:00
unzip.c Get repository to build with GCC 11 2022-09-13 04:14:55 -07:00
unzip.h Add Info-ZIP unzip.com 2022-06-10 05:09:11 -07:00
unzip.mk Get --ftrace working on aarch64 2023-06-05 23:35:31 -07:00
unzip.txt Add Info-ZIP unzip.com 2022-06-10 05:09:11 -07:00
unzpriv.h Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
unzvers.h Add Info-ZIP unzip.com 2022-06-10 05:09:11 -07:00
zip.h Add Info-ZIP unzip.com 2022-06-10 05:09:11 -07:00
zipinfo.c Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
zipinfo.txt Revert whitespace fixes to third_party (#501) 2022-07-21 21:46:07 -07:00

DESCRIPTION

  The UNIX unzip command, courtesy of the Info-ZIP project.

PROVENANCE

  unzip610b.zip (circa 2010)
  https://sourceforge.net/projects/infozip/files/unreleased%20Betas/UnZip%20betas/

LICENSE

  BSD-like with Apache-like requirement that changes be documented.

LOCAL CHANGES

  The only way this software differs from the normal InfoZIP sources is
  that we're linking the Cosmopolitan C Library, which enables it to be
  built as an Actually Portable Executable.

  Minor changes include:

  - Normalization of header / build config for platform / repository
    sed -i -e '/# *include  *<.*/d'  *.*
    sed -i -e 's!# *include  *"!#include "third_party/unzip/!' *.*
    sed -i -e '1 i\// clang-format off' *.c *.h

  - Fixed a lot of static analysis buffer overflow warnings.