Forráskód Böngészése

Updated to bzip2 1.1.0.

Brucey 2 éve
szülő
commit
472cafe49b
48 módosított fájl, 1786 hozzáadás és 1337 törlés
  1. 78 0
      bzip2.mod/bzip2/.appveyor.yml
  2. 97 0
      bzip2.mod/bzip2/.gitlab-ci.yml
  3. 0 1
      bzip2.mod/bzip2/AUTHORS
  4. 137 86
      bzip2.mod/bzip2/CMakeLists.txt
  5. 2 0
      bzip2.mod/bzip2/CMakeOptions.txt
  6. 20 3
      bzip2.mod/bzip2/COMPILING.md
  7. 6 6
      bzip2.mod/bzip2/COPYING
  8. 0 82
      bzip2.mod/bzip2/NEWS
  9. 322 198
      bzip2.mod/bzip2/NEWS.md
  10. 4 4
      bzip2.mod/bzip2/README.XML.STUFF
  11. 69 69
      bzip2.mod/bzip2/README.md
  12. 68 68
      bzip2.mod/bzip2/blocksort.c
  13. 8 8
      bzip2.mod/bzip2/bzdiff
  14. 3 3
      bzip2.mod/bzip2/bzgrep
  15. 203 210
      bzip2.mod/bzip2/bzip2.c
  16. 3 3
      bzip2.mod/bzip2/bzip2.doap
  17. 2 3
      bzip2.mod/bzip2/bzip2.txt
  18. 25 31
      bzip2.mod/bzip2/bzip2recover.c
  19. 120 119
      bzip2.mod/bzip2/bzlib.c
  20. 83 83
      bzip2.mod/bzip2/bzlib.h
  21. 13 13
      bzip2.mod/bzip2/bzlib_private.h
  22. 26 0
      bzip2.mod/bzip2/cmake/SymLink.cmake
  23. 48 49
      bzip2.mod/bzip2/compress.c
  24. 2 2
      bzip2.mod/bzip2/crctable.c
  25. 25 25
      bzip2.mod/bzip2/decompress.c
  26. 12 5
      bzip2.mod/bzip2/docs/RELEASING.md
  27. 7 4
      bzip2.mod/bzip2/docs/bz-html.xsl
  28. 1 1
      bzip2.mod/bzip2/docs/entities.xml
  29. 4 4
      bzip2.mod/bzip2/docs/format.pl
  30. 52 36
      bzip2.mod/bzip2/docs/manual.xml
  31. 1 1
      bzip2.mod/bzip2/docs/meson.build
  32. 5 5
      bzip2.mod/bzip2/docs/xmlproc.sh
  33. 6 6
      bzip2.mod/bzip2/huffman.c
  34. 1 1
      bzip2.mod/bzip2/makefile.msc
  35. 8 8
      bzip2.mod/bzip2/man/bzgrep.1
  36. 93 72
      bzip2.mod/bzip2/man/bzip2.1
  37. 4 4
      bzip2.mod/bzip2/man/bzip2.1.preformatted
  38. 11 4
      bzip2.mod/bzip2/meson.build
  39. 2 2
      bzip2.mod/bzip2/mk251.c
  40. 54 54
      bzip2.mod/bzip2/randtable.c
  41. 4 4
      bzip2.mod/bzip2/spewG.c
  42. 39 41
      bzip2.mod/bzip2/tests/CMakeLists.txt
  43. 2 2
      bzip2.mod/bzip2/tests/meson.build
  44. 103 4
      bzip2.mod/bzip2/tests/runtest.py
  45. 7 7
      bzip2.mod/bzip2/unzcrash.c
  46. 3 3
      bzip2.mod/bzip2/version.rc
  47. 2 2
      bzip2.mod/bzip2/version.rc.in
  48. 1 1
      bzip2.mod/include/bz_version.h

+ 78 - 0
bzip2.mod/bzip2/.appveyor.yml

@@ -0,0 +1,78 @@
+environment:
+  matrix:
+
+    - COMPILER: MSVC2019
+      PLATFORM: x86
+      CC: cl.exe
+      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
+      CMAKE_GENERATOR: NMake Makefiles
+
+    - COMPILER: MSVC2019
+      PLATFORM: amd64
+      CC: cl.exe
+      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
+      CMAKE_GENERATOR: NMake Makefiles
+
+    - COMPILER: MSVC2017
+      PLATFORM: x86
+      CC: cl.exe
+      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
+      CMAKE_GENERATOR: NMake Makefiles
+
+    - COMPILER: MSVC2017
+      PLATFORM: amd64
+      CC: cl.exe
+      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
+      CMAKE_GENERATOR: NMake Makefiles
+
+    - COMPILER: MSVC2015
+      PLATFORM: x86
+      CC: cl.exe
+      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
+      CMAKE_GENERATOR: NMake Makefiles
+
+    - COMPILER: MSVC2015
+      PLATFORM: amd64
+      CC: cl.exe
+      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
+      CMAKE_GENERATOR: NMake Makefiles
+
+    - COMPILER: GCC
+      ARCH: 32
+      CC: gcc.exe
+      CMAKE_GENERATOR: MinGW Makefiles
+
+    - COMPILER: GCC
+      ARCH: 64
+      CC: gcc.exe
+      CMAKE_GENERATOR: MinGW Makefiles
+
+install:
+
+- if [%COMPILER%]==[MSVC2015] if [%PLATFORM%]==[amd64] call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64
+- if [%COMPILER%]==[MSVC2015] if [%PLATFORM%]==[amd64] call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
+- if [%COMPILER%]==[MSVC2015] if [%PLATFORM%]==[x86] call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
+
+- if [%COMPILER%]==[MSVC2017] if [%PLATFORM%]==[amd64] call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
+- if [%COMPILER%]==[MSVC2017] if [%PLATFORM%]==[x86] call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
+
+- if [%COMPILER%]==[MSVC2019] call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" %PLATFORM%
+
+- if [%COMPILER%]==[GCC] del /F /Q "C:\Program Files\Git\usr\bin\sh.exe"
+- if [%COMPILER%]==[GCC] set "PATH=C:\msys64\mingw%ARCH%\bin;%PATH%"
+
+build_script:
+- mkdir build
+- cd build
+
+- cmake -G "%CMAKE_GENERATOR%" -DCMAKE_BUILD_TYPE=Release ..
+- cmake --build . --target install
+
+test_script:
+- cmake --build . --target check
+
+# Enable this to be able to login to the build worker. You can use the
+# `remmina` program in Ubuntu, use the login information that the line below
+# prints into the log.
+#on_finish:
+#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

+ 97 - 0
bzip2.mod/bzip2/.gitlab-ci.yml

@@ -0,0 +1,97 @@
+# CI setup based on https://gitlab.gnome.org/GNOME/librsvg/blob/master/.gitlab-ci.yml
+
+variables:
+  AMD64_DEBIAN_TESTING: debian:testing
+  AMD64_UBUNTU_BIONIC: ubuntu:bionic
+  AMD64_FEDORA_LATEST: 'registry.fedoraproject.org/fedora:30'
+  AMD64_FEDORA_RAWHIDE: 'registry.fedoraproject.org/fedora:rawhide'
+  AMD64_OPENSUSE_LEAP: opensuse/leap
+  AMD64_OPENSUSE_TUMBLEWEED: opensuse/tumbleweed
+
+  I386_UBUNTU_BIONIC: 'i386/ubuntu:bionic'
+
+stages:
+  - test
+
+.meson_test:
+  stage: test
+  script:
+    - meson builddir
+    - ninja -C builddir
+    - meson test -C builddir --print-errorlogs
+  after_script:
+    - cp builddir/meson-logs/meson-log.txt .
+    - rm -rf builddir
+  artifacts:
+    paths:
+      - 'meson-log.txt'
+
+.cmake_test:
+  stage: test
+  script:
+    - mkdir builddir && cd builddir
+    - cmake ..
+    - cmake --build . --config Release
+    - make check
+  after_script:
+    - cp builddir/CMakeFiles/CMakeOutput.log .
+    - rm -rf builddir
+  artifacts:
+    paths:
+      - 'CMakeOutput.log'
+
+debian:testing:
+  extends: '.meson_test'
+  image: $AMD64_DEBIAN_TESTING
+  before_script:
+    - apt-get update -y
+    - apt-get install -y gcc meson python3-distutils
+
+debian:testing:cmake:
+  extends: '.cmake_test'
+  image: $AMD64_DEBIAN_TESTING
+  before_script:
+    - apt-get update -y
+    - apt-get install -y gcc make python3-pip cmake
+
+ubuntu:bionic:meson:
+  extends: '.meson_test'
+  image: $AMD64_UBUNTU_BIONIC
+  before_script:
+    - apt-get update -y
+    - apt-get install -y gcc python3-pip ninja-build
+    - pip3 install meson
+
+ubuntu:bionic:i386:
+  extends: '.meson_test'
+  image: $I386_UBUNTU_BIONIC
+  before_script:
+    - apt-get update -y
+    - apt-get install -y gcc python3-pip ninja-build
+    - pip3 install meson
+
+fedora:30:
+  extends: '.meson_test'
+  image: $AMD64_FEDORA_LATEST
+  before_script:
+    - dnf install -y gcc meson
+
+fedora:rawhide:
+  extends: '.meson_test'
+  image: $AMD64_FEDORA_RAWHIDE
+  before_script:
+    - dnf install -y gcc meson
+  allow_failure: true
+
+opensuse/leap:
+  extends: '.meson_test'
+  image: $AMD64_OPENSUSE_LEAP
+  before_script:
+    - zypper install -y gcc ninja python3-pip
+    - pip3 install meson
+
+opensuse/tumbleweed:
+  extends: '.meson_test'
+  image: $AMD64_OPENSUSE_TUMBLEWEED
+  before_script:
+    - zypper install -y gcc meson

+ 0 - 1
bzip2.mod/bzip2/AUTHORS

@@ -17,4 +17,3 @@ Robert Linden
 Solar Designer
 Trond Eivind Glomsrod
 Volker Schmidt
-Volker Schmidt

+ 137 - 86
bzip2.mod/bzip2/CMakeLists.txt

@@ -1,31 +1,32 @@
 cmake_minimum_required(VERSION 3.12)
 
 project(bzip2
-         VERSION 1.0.7
-         DESCRIPTION "This Bzip2/libbz2 a program and library for lossless block-sorting data compression."
-         LANGUAGES C)
+        VERSION 1.1.0
+        DESCRIPTION "This Bzip2/libbz2 a program and library for lossless block-sorting data compression."
+        LANGUAGES C)
 
 # See versioning rule:
 #  http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
 #
 # KEEP THESE IN SYNC WITH meson.build OR STUFF WILL BREAK!
 set(LT_CURRENT  1)
-set(LT_REVISION 7)
+set(LT_REVISION 9)
 set(LT_AGE      0)
 
-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
 include(Version)
+include(SymLink)
 
 set(BZ_VERSION ${PROJECT_VERSION})
 configure_file (
-  "${PROJECT_SOURCE_DIR}/bz_version.h.in"
-  "${PROJECT_BINARY_DIR}/bz_version.h"
+    ${PROJECT_SOURCE_DIR}/bz_version.h.in
+    ${PROJECT_BINARY_DIR}/bz_version.h
 )
-include_directories("${PROJECT_BINARY_DIR}")
+include_directories(${PROJECT_BINARY_DIR})
 
 math(EXPR LT_SOVERSION "${LT_CURRENT} - ${LT_AGE}")
 set(LT_VERSION "${LT_SOVERSION}.${LT_AGE}.${LT_REVISION}")
-set(PACKAGE_VERSION "${PROJECT_VERSION}")
+set(PACKAGE_VERSION ${PROJECT_VERSION})
 HexVersion(PACKAGE_VERSION_NUM ${PROJECT_VERSION_MAJOR} ${PROJECT_VERSION_MINOR} ${PROJECT_VERSION_PATCH})
 
 set(ENABLE_APP_DEFAULT ON)
@@ -34,35 +35,35 @@ set(ENABLE_DOCS_DEFAULT OFF)
 include(CMakeOptions.txt)
 
 if(ENABLE_LIB_ONLY AND (ENABLE_APP OR ENABLE_EXAMPLES))
-  # Remember when disabled options are disabled for later diagnostics.
-  set(ENABLE_LIB_ONLY_DISABLED_OTHERS 1)
+    # Remember when disabled options are disabled for later diagnostics.
+    set(ENABLE_LIB_ONLY_DISABLED_OTHERS 1)
 else()
-  set(ENABLE_LIB_ONLY_DISABLED_OTHERS 0)
+    set(ENABLE_LIB_ONLY_DISABLED_OTHERS 0)
 endif()
 if(ENABLE_LIB_ONLY)
-  set(ENABLE_APP      OFF)
-  set(ENABLE_EXAMPLES OFF)
+    set(ENABLE_APP      OFF)
+    set(ENABLE_EXAMPLES OFF)
 endif()
 
 # Do not disable assertions based on CMAKE_BUILD_TYPE.
-foreach(_build_type "Release" "MinSizeRel" "RelWithDebInfo")
-  foreach(_lang C)
-    string(TOUPPER "CMAKE_${_lang}_FLAGS_${_build_type}" _var)
-    string(REGEX REPLACE "(^|)[/-]D *NDEBUG($|)" " " ${_var} "${${_var}}")
-  endforeach()
+foreach(_build_type Release MinSizeRel RelWithDebInfo)
+    foreach(_lang C)
+        string(TOUPPER CMAKE_${_lang}_FLAGS_${_build_type} _var)
+        string(REGEX REPLACE "(^|)[/-]D *NDEBUG($|)" " " ${_var} "${${_var}}")
+    endforeach()
 endforeach()
 
 # Support the latest c++ standard available.
 include(ExtractValidFlags)
 
 if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
-  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the build type" FORCE)
+    set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the build type" FORCE)
 
-  # Include "None" as option to disable any additional (optimization) flags,
-  # relying on just CMAKE_C_FLAGS and CMAKE_CXX_FLAGS (which are empty by
-  # default). These strings are presented in cmake-gui.
-  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
-    "None" "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
+    # Include "None" as option to disable any additional (optimization) flags,
+    # relying on just CMAKE_C_FLAGS and CMAKE_CXX_FLAGS (which are empty by
+    # default). These strings are presented in cmake-gui.
+    set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
+        None Debug Release MinSizeRel RelWithDebInfo)
 endif()
 
 include(GNUInstallDirs)
@@ -70,23 +71,20 @@ include(GNUInstallDirs)
 # For test scripts and documentation
 find_package(Python3)
 
-# Always use '-fPIC'/'-fPIE' option.
-set(CMAKE_POSITION_INDEPENDENT_CODE ON)
-
 # Checks for header files.
 include(CheckIncludeFile)
-check_include_file("arpa/inet.h"    HAVE_ARPA_INET_H)
-check_include_file("fcntl.h"        HAVE_FCNTL_H)
-check_include_file("inttypes.h"     HAVE_INTTYPES_H)
-check_include_file("limits.h"       HAVE_LIMITS_H)
-check_include_file("netdb.h"        HAVE_NETDB_H)
-check_include_file("netinet/in.h"   HAVE_NETINET_IN_H)
-check_include_file("pwd.h"          HAVE_PWD_H)
-check_include_file("sys/socket.h"   HAVE_SYS_SOCKET_H)
-check_include_file("sys/time.h"     HAVE_SYS_TIME_H)
-check_include_file("syslog.h"       HAVE_SYSLOG_H)
-check_include_file("time.h"         HAVE_TIME_H)
-check_include_file("unistd.h"       HAVE_UNISTD_H)
+check_include_file(arpa/inet.h    HAVE_ARPA_INET_H)
+check_include_file(fcntl.h        HAVE_FCNTL_H)
+check_include_file(inttypes.h     HAVE_INTTYPES_H)
+check_include_file(limits.h       HAVE_LIMITS_H)
+check_include_file(netdb.h        HAVE_NETDB_H)
+check_include_file(netinet/in.h   HAVE_NETINET_IN_H)
+check_include_file(pwd.h          HAVE_PWD_H)
+check_include_file(sys/socket.h   HAVE_SYS_SOCKET_H)
+check_include_file(sys/time.h     HAVE_SYS_TIME_H)
+check_include_file(syslog.h       HAVE_SYSLOG_H)
+check_include_file(time.h         HAVE_TIME_H)
+check_include_file(unistd.h       HAVE_UNISTD_H)
 
 include(CheckTypeSize)
 # Checks for typedefs, structures, and compiler characteristics.
@@ -176,7 +174,7 @@ else()
 endif()
 
 if(ENABLE_DEBUG)
-  set(DEBUGBUILD 1)
+    set(DEBUGBUILD 1)
 endif()
 
 #add_definitions(-DHAVE_CONFIG_H)
@@ -185,25 +183,25 @@ endif()
 # autotools-compatible names
 # Sphinx expects relative paths in the .rst files. Use the fact that the files
 # below are all one directory level deep.
-file(RELATIVE_PATH top_srcdir   "${CMAKE_CURRENT_BINARY_DIR}/dir" "${CMAKE_CURRENT_SOURCE_DIR}")
-file(RELATIVE_PATH top_builddir "${CMAKE_CURRENT_BINARY_DIR}/dir" "${CMAKE_CURRENT_BINARY_DIR}")
-set(abs_top_srcdir   "${CMAKE_CURRENT_SOURCE_DIR}")
-set(abs_top_builddir "${CMAKE_CURRENT_BINARY_DIR}")
+file(RELATIVE_PATH top_srcdir   ${CMAKE_CURRENT_BINARY_DIR}/dir ${CMAKE_CURRENT_SOURCE_DIR})
+file(RELATIVE_PATH top_builddir ${CMAKE_CURRENT_BINARY_DIR}/dir ${CMAKE_CURRENT_BINARY_DIR})
+set(abs_top_srcdir   ${CMAKE_CURRENT_SOURCE_DIR})
+set(abs_top_builddir ${CMAKE_CURRENT_BINARY_DIR})
 # bzip2.pc (pkg-config file)
-set(prefix      "${CMAKE_INSTALL_PREFIX}")
-set(exec_prefix "${CMAKE_INSTALL_PREFIX}")
-set(bindir      "${CMAKE_INSTALL_FULL_BINDIR}")
-set(sbindir     "${CMAKE_INSTALL_FULL_SBINDIR}")
-set(libdir      "${CMAKE_INSTALL_FULL_LIBDIR}")
-set(includedir  "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
-set(VERSION         "${PACKAGE_VERSION}")
+set(prefix      ${CMAKE_INSTALL_PREFIX})
+set(exec_prefix ${CMAKE_INSTALL_PREFIX})
+set(bindir      ${CMAKE_INSTALL_FULL_BINDIR})
+set(sbindir     ${CMAKE_INSTALL_FULL_SBINDIR})
+set(libdir      ${CMAKE_INSTALL_FULL_LIBDIR})
+set(includedir  ${CMAKE_INSTALL_FULL_INCLUDEDIR})
+set(VERSION     ${PACKAGE_VERSION})
 
 configure_file(
     bzip2.pc.in
     ${CMAKE_CURRENT_BINARY_DIR}/bzip2.pc
     @ONLY)
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/bzip2.pc"
-    DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/bzip2.pc
+    DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
 
 #
 # The build targets.
@@ -211,20 +209,20 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/bzip2.pc"
 #   These targets would be included with `add_subdirectory()`
 #
 set(BZ2_SOURCES
-    "blocksort.c"
-    "huffman.c"
-    "crctable.c"
-    "randtable.c"
-    "compress.c"
-    "decompress.c"
-    "bzlib.c")
+    blocksort.c
+    huffman.c
+    crctable.c
+    randtable.c
+    compress.c
+    decompress.c
+    bzlib.c)
 
 # The bz2 OBJECT-library, required for bzip2, bzip2recover.
 add_library(bz2_ObjLib OBJECT)
 target_sources(bz2_ObjLib
     PRIVATE   ${BZ2_SOURCES}
-    PUBLIC    "${CMAKE_CURRENT_SOURCE_DIR}/bzlib_private.h"
-    INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/bzlib.h")
+    PUBLIC    ${CMAKE_CURRENT_SOURCE_DIR}/bzlib_private.h
+    INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/bzlib.h)
 
 # Windows resource file
 set(BZ2_RES "")
@@ -242,59 +240,112 @@ if(ENABLE_SHARED_LIB)
     add_library(bz2 SHARED ${BZ2_RES})
     target_sources(bz2
         PRIVATE   ${BZ2_SOURCES}
-                  "${CMAKE_CURRENT_SOURCE_DIR}/libbz2.def"
-        PUBLIC    "${CMAKE_CURRENT_SOURCE_DIR}/bzlib_private.h"
-        INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/bzlib.h")
+                  ${CMAKE_CURRENT_SOURCE_DIR}/libbz2.def
+        PUBLIC    ${CMAKE_CURRENT_SOURCE_DIR}/bzlib_private.h
+        INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/bzlib.h)
+    # Always use '-fPIC'/'-fPIE' option for shared libraries.
+    set_property(TARGET bz2 PROPERTY POSITION_INDEPENDENT_CODE ON)
     set_target_properties(bz2 PROPERTIES
         COMPILE_FLAGS "${WARNCFLAGS}"
         VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION})
-    install(TARGETS bz2 DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-    install(FILES bzlib.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
+    install(TARGETS bz2 DESTINATION ${CMAKE_INSTALL_LIBDIR})
+    install(FILES bzlib.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+
+    if(USE_OLD_SONAME)
+        # Hack to support the old libbz2.so.1.0 version by including an extra copy.
+        # Technically the old SONAME is not libtool compatible.
+        # This hack is to support binary compatibility with libbz2 in some distro packages.
+        if(UNIX AND NOT APPLE)
+            add_library(bz2_old_soname SHARED ${BZ2_RES})
+            target_sources(bz2_old_soname
+                PRIVATE   ${BZ2_SOURCES}
+                        ${CMAKE_CURRENT_SOURCE_DIR}/libbz2.def
+                PUBLIC    ${CMAKE_CURRENT_SOURCE_DIR}/bzlib_private.h
+                INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/bzlib.h
+            )
+            set_target_properties(bz2_old_soname PROPERTIES
+                COMPILE_FLAGS "${WARNCFLAGS}"
+                VERSION ${LT_SOVERSION}.${LT_AGE} SOVERSION ${LT_SOVERSION}.${LT_AGE}
+                OUTPUT_NAME bz2
+            )
+            install(TARGETS bz2_old_soname DESTINATION ${CMAKE_INSTALL_LIBDIR})
+        endif()
+    endif()
 endif()
 
 if(ENABLE_STATIC_LIB)
     # The libbz2 static library.
     add_library(bz2_static STATIC)
     target_sources(bz2_static
-        PRIVATE   ${BZ2_SOURCES}
-        PUBLIC    "${CMAKE_CURRENT_SOURCE_DIR}/bzlib_private.h"
-        INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/bzlib.h")
+        PRIVATE     ${BZ2_SOURCES}
+        PUBLIC      ${CMAKE_CURRENT_SOURCE_DIR}/bzlib_private.h
+        INTERFACE   ${CMAKE_CURRENT_SOURCE_DIR}/bzlib.h)
     set_target_properties(bz2_static PROPERTIES
-        COMPILE_FLAGS "${WARNCFLAGS}"
-        VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION}
-        ARCHIVE_OUTPUT_NAME bz2)
-    target_compile_definitions(bz2_static PUBLIC "-DBZ2_STATICLIB")
-    install(TARGETS bz2_static DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-    install(FILES bzlib.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
+        COMPILE_FLAGS       "${WARNCFLAGS}"
+        VERSION             ${LT_VERSION}
+        SOVERSION           ${LT_SOVERSION}
+        ARCHIVE_OUTPUT_NAME bz2_static)
+    target_compile_definitions(bz2_static PUBLIC BZ2_STATICLIB)
+    install(TARGETS bz2_static DESTINATION ${CMAKE_INSTALL_LIBDIR})
+    install(FILES bzlib.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
 endif()
 
 if(ENABLE_APP)
     # The bzip2 executable.
     add_executable(bzip2)
     target_sources(bzip2
-        PRIVATE   "bzip2.c")
+        PRIVATE   bzip2.c)
     target_link_libraries(bzip2
         PRIVATE   bz2_ObjLib)
-    install(TARGETS bzip2 DESTINATION "${CMAKE_INSTALL_BINDIR}")
+    if(WIN32)
+        target_compile_definitions(bzip2 PUBLIC BZ_LCCWIN32 BZ_UNIX=0)
+    else()
+        target_compile_definitions(bzip2 PUBLIC BZ_LCCWIN32=0 BZ_UNIX)
+    endif()
+    install(TARGETS bzip2 DESTINATION ${CMAKE_INSTALL_BINDIR})
 
-    # The bzip2 executable.
+    # Create bzip2 copies bzcat and bunzip.
+    # The default behavior is altered in bzip2.c code by checking the program name.
+    install_target_symlink(bzip2 bzcat)
+    install_target_symlink(bzip2 bunzip)
+
+    # The bzip2recover executable.
     add_executable(bzip2recover)
     target_sources(bzip2recover
-        PRIVATE   "bzip2recover.c")
+        PRIVATE   bzip2recover.c)
     target_link_libraries(bzip2recover
         PRIVATE bz2_ObjLib)
-    install(TARGETS bzip2recover DESTINATION "${CMAKE_INSTALL_BINDIR}")
+    if(WIN32)
+        target_compile_definitions(bzip2recover PUBLIC BZ_LCCWIN32 BZ_UNIX=0)
+    else()
+        target_compile_definitions(bzip2recover PUBLIC BZ_LCCWIN32=0 BZ_UNIX)
+    endif()
+    install(TARGETS bzip2recover DESTINATION ${CMAKE_INSTALL_BINDIR})
 
     if(ENABLE_EXAMPLES)
         if(ENABLE_SHARED_LIB)
             # The dlltest executable.
             add_executable(dlltest)
             target_sources(dlltest
-                PRIVATE   "dlltest.c")
+                PRIVATE   dlltest.c)
             target_link_libraries(dlltest bz2)
-            install(TARGETS dlltest DESTINATION "${CMAKE_INSTALL_BINDIR}")
+            install(TARGETS dlltest DESTINATION ${CMAKE_INSTALL_BINDIR})
         endif()
     endif()
+
+    if(NOT WIN32)
+        # Install shell scripts, and renamed copies.
+        install(PROGRAMS bzdiff bzgrep bzmore
+            DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+        install_script_symlink(bzdiff bzcmp)
+
+        install_script_symlink(bzgrep bzegrep)
+        install_script_symlink(bzgrep bzfgrep)
+
+        install_script_symlink(bzmore bzless)
+    endif()
+
 endif()
 
 if(Python3_FOUND)
@@ -305,7 +356,7 @@ endif()
 
 add_subdirectory(man)
 
-set(DOCGEN_EXECS xsltproc perl xmllint egrep pdfxmltex pdftops)
+set(DOCGEN_EXECS xsltproc perl xmllint grep pdfxmltex pdftops)
 
 if(ENABLE_DOCS)
     foreach(EXEC IN LISTS DOCGEN_EXECS)
@@ -335,7 +386,7 @@ message(STATUS "Summary of build options:
         Build type:     ${CMAKE_BUILD_TYPE}
         C compiler:     ${CMAKE_C_COMPILER}
         CFLAGS:         ${CMAKE_C_FLAGS_${_build_type}} ${CMAKE_C_FLAGS}
-        WARNCFLAGS:    ${WARNCFLAGS}
+        WARNCFLAGS:     ${WARNCFLAGS}
     Test:
         Python:         ${Python3_FOUND} (${Python3_VERSION}, ${Python3_EXECUTABLE})
     Docs:

+ 2 - 0
bzip2.mod/bzip2/CMakeOptions.txt

@@ -18,3 +18,5 @@ option(ENABLE_LIB_ONLY   "Build libbz2 only.  This is a short hand for -DENABLE_
 option(ENABLE_STATIC_LIB "Build libbz2 in static mode also")
 
 option(ENABLE_SHARED_LIB "Build libbz2 as a shared library" ON)
+
+option(USE_OLD_SONAME "Use libbz2.so.1.0 for compatibility with old Makefiles" OFF)

+ 20 - 3
bzip2.mod/bzip2/COMPILING.md

@@ -12,10 +12,27 @@ Meson works for Unix-like OSes and Windows; nmake is only for Windows.
 [Meson]: https://mesonbuild.com
 [CMake]: https://cmake.org
 
+> _Important note when compiling for Linux_:
+>
+> The SONAME for libbz2 for version 1.0 was: `libbz2.so.1.0`
+> Some distros patched it to libbz2.so.1 to be supported by libtool.
+> Others did not.
+>
+> We had to make a choice when switching from Makefiles -> CMake + Meson.
+> So, the SONAME for libbz2 for version 1.1 is now: `libbz2.so.1`
+>
+> Distros that need it to be ABI compatible with the old SONAME may either:
+> 1. Use CMake for the build with the option `-D USE_OLD_SONAME=ON`.
+>    This will build an extra copy of the library with the old SONAME.
+>
+> 2. Use `patchelf --set-soname` after the build to change the SONAME and
+>    install an extra symlink manually: `libbz2.so.1.0 -> libbz2.so.1.0.9`
+>
+> You can check the SONAME with: `objdump -p libbz2.so.1.0.9 | grep SONAME`
 
 ## Using Meson
 
-Meson provides a [large number of built-in options](https://mesonbuild.com/Builtin-options.html) 
+Meson provides a [large number of built-in options](https://mesonbuild.com/Builtin-options.html)
 to control compilation. A few important ones are listed below:
 
 - -Ddefault_library=[static|shared|both], defaults to shared, if you wish to
@@ -36,7 +53,7 @@ Meson will never change compilers once configured, so $CC is perfectly safe.
 
 You will need
  - Python 3.5 or newer (for Meson)
- - meson (Verison 0.48 or newer)
+ - meson (Version 0.48 or newer)
  - ninja
  - pkg-config
  - A C compiler such as GCC or Clang
@@ -56,7 +73,7 @@ You will need
  Once you have installed the dependencies, the following should work
  to use the standard Meson configuration, a `builddir` for
  compilation, and a `/usr` prefix for installation:
- 
+
  ```sh
  meson --prefix /usr builddir/
  ninja -C builddir

+ 6 - 6
bzip2.mod/bzip2/COPYING

@@ -12,16 +12,16 @@ are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 
-2. The origin of this software must not be misrepresented; you must 
-   not claim that you wrote the original software.  If you use this 
-   software in a product, an acknowledgment in the product 
+2. The origin of this software must not be misrepresented; you must
+   not claim that you wrote the original software.  If you use this
+   software in a product, an acknowledgment in the product
    documentation would be appreciated but is not required.
 
 3. Altered source versions must be plainly marked as such, and must
    not be misrepresented as being the original software.
 
-4. The name of the author may not be used to endorse or promote 
-   products derived from this software without specific prior written 
+4. The name of the author may not be used to endorse or promote
+   products derived from this software without specific prior written
    permission.
 
 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
@@ -37,6 +37,6 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 Julian Seward, [email protected]
-bzip2/libbzip2 version 1.0.6 of 6 September 2010
+bzip2/libbzip2 version 1.1.0 of 6 September 2010
 
 --------------------------------------------------------------------------

+ 0 - 82
bzip2.mod/bzip2/NEWS

@@ -1,82 +0,0 @@
-Changes in version 1.0.7
-========================
-
-* The new maintainer of bzip2 is Federico Mena Quintero
-  <[email protected]>.
-
-* Bzip2 is now maintained under version control at
-  https://gitlab.com/federicomenaquintero/bzip2
-
-The following are changes that have accumulated in various
-distributions since bzip2-1.0.6:
-
-* Fix bashisms in bzgrep (Led).
-
-* Fix unsafe strcpy in bzip2recover (Ivana Varekova).
-  https://bugzilla.redhat.com/show_bug.cgi?id=226979
-
-* Fix bzgrep so it doesn't always return a 0 exit code (Kristýna Streitová)
-
-* CVE-2016-3189 - Fix use-after-free in bzip2recover (Jakub Martisko)
-  https://bugzilla.redhat.com/show_bug.cgi?id=1319648
-
-* Use O_CLOEXEC for bzopen()
-
-* Fix mingw compilation (Marty E. Plummer, Dylan Baker)
-
-* Fix Visual Studio compilation (Phil Ross)
-
-* Fix #10: bunzip2 -qt returns 0 for corrupt archives (Wenzong Fan)
-
-* Fix undefined behavior in macros with the shift-left operator
-  (Paul Kehrer)
-
-* Fix a 'not a normal file' error when compressing large files on
-  Windows (Phil Ross)
-
-* Don't let bzip2recover overwrite existing output files by default
-  (Colin Phipps)
-
-This is a new bugfix:
-
-* CVE-2019-12900 - Detect out-of-range nSelectors in corrupted files
-  (Albert Astals Cid).  Found through fuzzing karchive.
-
-Build system changes:
-
-* Instead of the historical Makefile, bzip2 now comes with two
-  supported build systems (Meson and CMake), and an unsupported one
-  (makefile.msc).  Either of the supported ones should build a shared
-  library as per modern practices.  Please see the file COMPILING.md for
-  details.
-
-Special thanks:
-
-* Julian Seward for ceding maintainership and providing lots of advice
-  and interesting anecdotes.
-
-* Mark Wielaard for constructing a repository based on tarballs from
-  the original releases.  For a different construction by Evan Nemerson, see
-  https://gitlab.com/federicomenaquintero/bzip2/issues/7
-
-* Erich Córdoba and Jordan Petridis for the Continuous Integration
-  infrastructure.
-
-* Phil Ross for the Windows build fixes.
-  
-* Dylan Baker for the Meson infrastructure.
-
-* Micah Snyder for the CMake infrastructure.
-
-* Stanislav Brabec for an Autotools infrastructure, which
-  became the basis for the Meson/CMake ones.
-
-* Jens Korte for fixing up the README.
-
-* All the people who submitted distribution-specific patches.
-
-
-Changes in version 1.0.6 and earlier
-====================================
-
-Please see the file NEWS-pre-1.0.7.

+ 322 - 198
bzip2.mod/bzip2/NEWS-pre-1.0.7 → bzip2.mod/bzip2/NEWS.md

@@ -1,204 +1,186 @@
- ------------------------------------------------------------------
- This file is part of bzip2/libbzip2, a program and library for
- lossless, block-sorting data compression.
+# Bzip2 News
 
- bzip2/libbzip2 version 1.0.6 of 6 September 2010
- Copyright (C) 1996-2010 Julian Seward <[email protected]>
+## 1.1.0 (unreleased)
 
- Please read the WARNING, DISCLAIMER and PATENTS sections in the 
- README file.
+### General Announcements
 
- This program is released under the terms of the license contained
- in the file LICENSE.
- ------------------------------------------------------------------
+[Micah Snyder](https://gitlab.com/micahsnyder) is the new maintainer of Bzip2
+for feature development (v1.1+).
 
+The Bzip2 feature development project is hosted on GitLab and can be found at
+https://gitlab.com/bzip2/bzip2
 
-0.9.0
-~~~~~
-First version after 0.1pl2.
+Bzip2 version 1.0 is being maintained by Mark Wielaard at Sourceware and can be
+found at https://sourceware.org/git/?p=bzip2.git
 
-   * Approx 10% faster compression, 30% faster decompression
-   * -t (test mode) is a lot quicker
-   * Can decompress concatenated compressed files
-   * Programming interface, so programs can directly read/write .bz2 files
-   * Less restrictive (BSD-style) licensing
-   * Flag handling more compatible with GNU gzip
-   * Much more documentation, i.e., a proper user manual
-   * Hopefully, improved portability (at least of the library)
+### Changes
 
+Build system changes:
 
-0.9.0a
-~~~~~~
-Removed 'ranlib' from Makefile, since most modern Unix-es 
-don't need it, or even know about it.
+* Instead of the historical Makefile, bzip2 now comes with two supported build
+  systems (Meson and CMake), and an unsupported one (makefile.msc).
+  Either of the supported ones should build a shared library as per modern
+  practices. Please see the file [COMPILING.md](COMPILING.md) for details.
 
+Important note when compiling for Linux:
 
-0.9.0b
-~~~~~~
-Fixed a problem with error reporting in bzip2.c.  This does not effect
-the library in any way.  Problem is: versions 0.9.0 and 0.9.0a (of the
-program proper) compress and decompress correctly, but give misleading
-error messages (internal panics) when an I/O error occurs, instead of
-reporting the problem correctly.  This shouldn't give any data loss
-(as far as I can see), but is confusing.
+* The SONAME for libbz2 for version 1.0 was: `libbz2.so.1.0`
+  Some distros patched it to `libbz2.so.1` to be supported by libtool.
+  Others did not.
 
-Made the inline declarations disappear for non-GCC compilers.
+  We had to make a choice when switching from Makefiles -> CMake + Meson.
+  So, the SONAME for libbz2 for version 1.1 is now: `libbz2.so.1`
 
+  Distros that need it to be ABI compatible with the old SONAME may either:
 
-0.9.0c
-~~~~~~
-Fixed some problems in the library pertaining to some boundary cases.
-This makes the library behave more correctly in those situations.  The
-fixes apply only to features (calls and parameters) not used by
-bzip2.c, so the non-fixedness of them in previous versions has no
-effect on reliability of bzip2.c.
+  1. Use CMake for the build with the option `-D USE_OLD_SONAME=ON`.
+     This will build an extra copy of the library with the old SONAME.
 
-In bzlib.c:
-   * made zero-length BZ_FLUSH work correctly in bzCompress().
-   * fixed bzWrite/bzRead to ignore zero-length requests.
-   * fixed bzread to correctly handle read requests after EOF.
-   * wrong parameter order in call to bzDecompressInit in
-     bzBuffToBuffDecompress.  Fixed.
+  2. Use `patchelf --set-soname` after the build to change the SONAME and
+    install an extra symlink manually: `libbz2.so.1.0 -> libbz2.so.1.0.9`
 
-In compress.c:
-   * changed setting of nGroups in sendMTFValues() so as to 
-     do a bit better on small files.  This _does_ effect
-     bzip2.c.
+  You can check the SONAME with: `objdump -p libbz2.so.1.0.9 | grep SONAME`
 
+Other changes, fixes:
 
-0.9.5a
-~~~~~~
-Major change: add a fallback sorting algorithm (blocksort.c)
-to give reasonable behaviour even for very repetitive inputs.
-Nuked --repetitive-best and --repetitive-fast since they are
-no longer useful.
+* Use `O_CLOEXEC` for `bzopen()`. (Federico Mena Quintero)
 
-Minor changes: mostly a whole bunch of small changes/
-bugfixes in the driver (bzip2.c).  Changes pertaining to the
-user interface are:
+* Fix `mingw` compilation. (Marty E. Plummer, Dylan Baker)
 
-   allow decompression of symlink'd files to stdout
-   decompress/test files even without .bz2 extension
-   give more accurate error messages for I/O errors
-   when compressing/decompressing to stdout, don't catch control-C
-   read flags from BZIP2 and BZIP environment variables
-   decline to break hard links to a file unless forced with -f
-   allow -c flag even with no filenames
-   preserve file ownerships as far as possible
-   make -s -1 give the expected block size (100k)
-   add a flag -q --quiet to suppress nonessential warnings
-   stop decoding flags after --, so files beginning in - can be handled
-   resolved inconsistent naming: bzcat or bz2cat ?
-   bzip2 --help now returns 0
+* Fix Visual Studio compilation. (Phil Ross)
 
-Programming-level changes are:
+* Don't let `bzip2recover` overwrite existing output files by default.
+  (Colin Phipps)
 
-   fixed syntax error in GET_LL4 for Borland C++ 5.02
-   let bzBuffToBuffDecompress return BZ_DATA_ERROR{_MAGIC}
-   fix overshoot of mode-string end in bzopen_or_bzdopen
-   wrapped bzlib.h in #ifdef __cplusplus ... extern "C" { ... }
-   close file handles under all error conditions
-   added minor mods so it compiles with DJGPP out of the box
-   fixed Makefile so it doesn't give problems with BSD make
-   fix uninitialised memory reads in dlltest.c
+### Special Thanks
 
-Summary:
+* Julian Seward for ceding maintainership and providing lots of advice
+  and interesting anecdotes.
 
-   * Compression speed is much less sensitive to the input
-     data than in previous versions.  Specifically, the very
-     slow performance caused by repetitive data is fixed.
-   * Many small improvements in file and flag handling.
-   * A Y2K statement.
+* Mark Wielaard for constructing a repository based on tarballs from
+  the original releases. For a different construction by Evan Nemerson, see
+  https://gitlab.com/bzip2/bzip2/issues/7
 
-0.9.5b
-~~~~~~
-Open stdin/stdout in binary mode for DJGPP.
+* Federico Mena Quintero for his maintainership of the project June 2019 -
+  June 2021. Federico picked up the project from Julian Seward. He coordinated
+  and contributed to a patching and modernization effort, completed in this
+  release.
 
-0.9.5c
-~~~~~~
-Changed BZ_N_OVERSHOOT to be ... + 2 instead of ... + 1.  The + 1
-version could cause the sorted order to be wrong in some extremely
-obscure cases.  Also changed setting of quadrant in blocksort.c.
+* Erich Córdoba and Jordan Petridis for the Continuous Integration
+  infrastructure.
 
-0.9.5d
-~~~~~~
-The only functional change is to make bzlibVersion() in the library
-return the correct string.  This has no effect whatsoever on the
-functioning of the bzip2 program or library.  Added a couple of casts
-so the library compiles without warnings at level 3 in MS Visual
-Studio 6.0.  Included a Y2K statement in the file Y2K_INFO.  All other
-changes are minor documentation changes.
+* Phil Ross for the Windows build fixes.
 
-1.0
-~~~
-Several minor bugfixes and enhancements:
+* Dylan Baker for the Meson infrastructure.
 
-* Large file support.  The library uses 64-bit counters to
-  count the volume of data passing through it.  bzip2.c 
-  is now compiled with -D_FILE_OFFSET_BITS=64 to get large
-  file support from the C library.  -v correctly prints out
-  file sizes greater than 4 gigabytes.  All these changes have
-  been made without assuming a 64-bit platform or a C compiler
-  which supports 64-bit ints, so, except for the C library
-  aspect, they are fully portable.
+* Micah Snyder for the CMake infrastructure.
 
-* Decompression robustness.  The library/program should be
-  robust to any corruption of compressed data, detecting and
-  handling _all_ corruption, instead of merely relying on
-  the CRCs.  What this means is that the program should 
-  never crash, given corrupted data, and the library should
-  always return BZ_DATA_ERROR.
+* Stanislav Brabec for an Autotools infrastructure, which
+  became the basis for the Meson/CMake ones.
 
-* Fixed an obscure race-condition bug only ever observed on
-  Solaris, in which, if you were very unlucky and issued
-  control-C at exactly the wrong time, both input and output
-  files would be deleted.
+* Jens Korte for fixing up the README.
 
-* Don't run out of file handles on test/decompression when
-  large numbers of files have invalid magic numbers.
+* All the people who submitted distribution-specific patches.
 
-* Avoid library namespace pollution.  Prefix all exported 
-  symbols with BZ2_.
 
-* Minor sorting enhancements from my DCC2000 paper.
+## 1.0.8 (13 Jul 19)
 
-* Advance the version number to 1.0, so as to counteract the
-  (false-in-this-case) impression some people have that programs 
-  with version numbers less than 1.0 are in some way, experimental,
-  pre-release versions.
+* Accept as many selectors as the file format allows.
+  This relaxes the fix for CVE-2019-12900 from 1.0.7
+  so that bzip2 allows decompression of `.bz2` files that
+  use (too) many selectors again.
 
-* Create an initial Makefile-libbz2_so to build a shared library.
-  Yes, I know I should really use libtool et al ...
+* Fix handling of large (> 4GB) files on Windows. (Phil Ross)
 
-* Make the program exit with 2 instead of 0 when decompression
-  fails due to a bad magic number (ie, an invalid bzip2 header).
-  Also exit with 1 (as the manual claims :-) whenever a diagnostic
-  message would have been printed AND the corresponding operation 
-  is aborted, for example
-     bzip2: Output file xx already exists.
-  When a diagnostic message is printed but the operation is not 
-  aborted, for example
-     bzip2: Can't guess original name for wurble -- using wurble.out
-  then the exit value 0 is returned, unless some other problem is
-  also detected.
+* Cleanup of `bzdiff` script so it doesn't use any bash extensions.
+  (Led)
 
-  I think it corresponds more closely to what the manual claims now.
+* Cleanup of `bzgrep` script so it handle multiple archives
+  correctly. (Kristýna Streitová)
 
+* There is now a bz2-files test suite at
+  https://sourceware.org/git/bzip2-tests.git
 
-1.0.1
-~~~~~
-* Modified dlltest.c so it uses the new BZ2_ naming scheme.
-* Modified makefile-msc to fix minor build probs on Win2k.
-* Updated README.COMPILATION.PROBLEMS.
 
-There are no functionality changes or bug fixes relative to version
-1.0.0.  This is just a documentation update + a fix for minor Win32
-build problems.  For almost everyone, upgrading from 1.0.0 to 1.0.1 is
-utterly pointless.  Don't bother.
+## 1.0.7 (27 Jun 19)
+
+* Fix undefined behavior in the macros `SET_BH`, `CLEAR_BH`, & `ISSET_BH`
+  with the shift-left operator (Paul Kehrer).
+
+* `bunzip2`: Fix return value when combining `--test` (`-t`) and `-q`.
+
+* `bzip2recover`: Fix buffer overflow for large `argv[0]`. (Ivana Varekova)
+  https://bugzilla.redhat.com/show_bug.cgi?id=226979
+
+* CVE-2016-3189 - Fix use-after-free in `bzip2recover`. (Jakub Martisko)
+  https://bugzilla.redhat.com/show_bug.cgi?id=1319648
+
+* CVE-2019-12900 - Make sure `nSelectors` is not out of range.
+  Found through fuzzing karchive. (Albert Astals Cid)
+
+
+## 1.0.6 (6 Sept 10)
+
+* CVE-2010-0405: Security fix. This was reported by Mikolaj Izdebski.
+
+* Make the documentation build on Ubuntu 10.04
+
+
+## 1.0.5 (10 Dec 07)
+
+Security fix only.  Fixes CERT-FI 20469 as it applies to bzip2.
 
 
-1.0.2
-~~~~~
+## 1.0.4 (20 Dec 06)
+
+Fixes some minor bugs since the last version, 1.0.3.
+
+* Fix file permissions race problem (CAN-2005-0953).
+
+* Avoid possible segfault in BZ2_bzclose.  From Coverity's NetBSD
+  scan.
+
+* 'const'/prototype cleanups in the C code.
+
+* Change default install location to /usr/local, and handle multiple
+  'make install's without error.
+
+* Sanitise file names more carefully in bzgrep.  Fixes CAN-2005-0758
+  to the extent that applies to bzgrep.
+
+* Use 'mktemp' rather than 'tempfile' in bzdiff.
+
+* Tighten up a couple of assertions in blocksort.c following automated
+  analysis.
+
+* Fix minor doc/comment bugs.
+
+
+## 1.0.3 (15 Feb 05)
+
+Fixes some minor bugs since the last version, 1.0.2.
+
+* Further robustification against corrupted compressed data.
+  There are currently no known bitstreams which can cause the
+  decompressor to crash, loop or access memory which does not
+  belong to it.  If you are using bzip2 or the library to
+  decompress bitstreams from untrusted sources, an upgrade
+  to 1.0.3 is recommended.  This fixes CAN-2005-1260.
+
+* The documentation has been converted to XML, from which html
+  and pdf can be derived.
+
+* Various minor bugs in the documentation have been fixed.
+
+* Fixes for various compilation warnings with newer versions of
+  gcc, and on 64-bit platforms.
+
+* The BZ_NO_STDIO cpp symbol was not properly observed in 1.0.2.
+  This has been fixed.
+
+
+## 1.0.2
+
 A bug fix release, addressing various minor issues which have appeared
 in the 18 or so months since 1.0.1 was released.  Most of the fixes
 are to do with file-handling or documentation bugs.  To the best of my
@@ -282,63 +264,205 @@ of bzip2:
 * added --fast and --best aliases for -1 -9 for gzip compatibility.
 
 
-1.0.3 (15 Feb 05)
-~~~~~~~~~~~~~~~~~
-Fixes some minor bugs since the last version, 1.0.2.
+## 1.0.1
 
-* Further robustification against corrupted compressed data.
-  There are currently no known bitstreams which can cause the
-  decompressor to crash, loop or access memory which does not
-  belong to it.  If you are using bzip2 or the library to 
-  decompress bitstreams from untrusted sources, an upgrade
-  to 1.0.3 is recommended.  This fixes CAN-2005-1260.
+* Modified dlltest.c so it uses the new BZ2_ naming scheme.
+* Modified makefile-msc to fix minor build probs on Win2k.
+* Updated README.COMPILATION.PROBLEMS.
 
-* The documentation has been converted to XML, from which html
-  and pdf can be derived.
+There are no functionality changes or bug fixes relative to version
+1.0.0.  This is just a documentation update + a fix for minor Win32
+build problems.  For almost everyone, upgrading from 1.0.0 to 1.0.1 is
+utterly pointless.  Don't bother.
 
-* Various minor bugs in the documentation have been fixed.
 
-* Fixes for various compilation warnings with newer versions of
-  gcc, and on 64-bit platforms.
+## 1.0
 
-* The BZ_NO_STDIO cpp symbol was not properly observed in 1.0.2.
-  This has been fixed.
+Several minor bugfixes and enhancements:
 
+* Large file support.  The library uses 64-bit counters to
+  count the volume of data passing through it.  bzip2.c
+  is now compiled with -D_FILE_OFFSET_BITS=64 to get large
+  file support from the C library.  -v correctly prints out
+  file sizes greater than 4 gigabytes.  All these changes have
+  been made without assuming a 64-bit platform or a C compiler
+  which supports 64-bit ints, so, except for the C library
+  aspect, they are fully portable.
 
-1.0.4 (20 Dec 06)
-~~~~~~~~~~~~~~~~~
-Fixes some minor bugs since the last version, 1.0.3.
+* Decompression robustness.  The library/program should be
+  robust to any corruption of compressed data, detecting and
+  handling _all_ corruption, instead of merely relying on
+  the CRCs.  What this means is that the program should
+  never crash, given corrupted data, and the library should
+  always return BZ_DATA_ERROR.
 
-* Fix file permissions race problem (CAN-2005-0953).
+* Fixed an obscure race-condition bug only ever observed on
+  Solaris, in which, if you were very unlucky and issued
+  control-C at exactly the wrong time, both input and output
+  files would be deleted.
 
-* Avoid possible segfault in BZ2_bzclose.  From Coverity's NetBSD
-  scan.
+* Don't run out of file handles on test/decompression when
+  large numbers of files have invalid magic numbers.
 
-* 'const'/prototype cleanups in the C code.
+* Avoid library namespace pollution.  Prefix all exported
+  symbols with BZ2_.
 
-* Change default install location to /usr/local, and handle multiple
-  'make install's without error.
+* Minor sorting enhancements from my DCC2000 paper.
 
-* Sanitise file names more carefully in bzgrep.  Fixes CAN-2005-0758
-  to the extent that applies to bzgrep.
+* Advance the version number to 1.0, so as to counteract the
+  (false-in-this-case) impression some people have that programs
+  with version numbers less than 1.0 are in some way, experimental,
+  pre-release versions.
 
-* Use 'mktemp' rather than 'tempfile' in bzdiff.
+* Create an initial Makefile-libbz2_so to build a shared library.
+  Yes, I know I should really use libtool et al ...
 
-* Tighten up a couple of assertions in blocksort.c following automated
-  analysis.
+* Make the program exit with 2 instead of 0 when decompression
+  fails due to a bad magic number (ie, an invalid bzip2 header).
+  Also exit with 1 (as the manual claims :-) whenever a diagnostic
+  message would have been printed AND the corresponding operation
+  is aborted, for example
+     bzip2: Output file xx already exists.
+  When a diagnostic message is printed but the operation is not
+  aborted, for example
+     bzip2: Can't guess original name for wurble -- using wurble.out
+  then the exit value 0 is returned, unless some other problem is
+  also detected.
 
-* Fix minor doc/comment bugs.
+  I think it corresponds more closely to what the manual claims now.
 
 
-1.0.5 (10 Dec 07)
-~~~~~~~~~~~~~~~~~
-Security fix only.  Fixes CERT-FI 20469 as it applies to bzip2.
+## 0.9.5d
 
+The only functional change is to make bzlibVersion() in the library
+return the correct string.  This has no effect whatsoever on the
+functioning of the bzip2 program or library.  Added a couple of casts
+so the library compiles without warnings at level 3 in MS Visual
+Studio 6.0.  Included a Y2K statement in the file Y2K_INFO.  All other
+changes are minor documentation changes.
 
-1.0.6 (6 Sept 10)
-~~~~~~~~~~~~~~~~~
 
-* Security fix for CVE-2010-0405.  This was reported by Mikolaj
-  Izdebski.
+## 0.9.5c
 
-* Make the documentation build on Ubuntu 10.04
+Changed BZ_N_OVERSHOOT to be ... + 2 instead of ... + 1.  The + 1
+version could cause the sorted order to be wrong in some extremely
+obscure cases.  Also changed setting of quadrant in blocksort.c.
+
+
+## 0.9.5b
+
+Open stdin/stdout in binary mode for DJGPP.
+
+
+## 0.9.5a
+
+Major change: add a fallback sorting algorithm (blocksort.c)
+to give reasonable behaviour even for very repetitive inputs.
+Nuked --repetitive-best and --repetitive-fast since they are
+no longer useful.
+
+Minor changes: mostly a whole bunch of small changes/
+bugfixes in the driver (bzip2.c).  Changes pertaining to the
+user interface are:
+
+   allow decompression of symlink'd files to stdout
+   decompress/test files even without .bz2 extension
+   give more accurate error messages for I/O errors
+   when compressing/decompressing to stdout, don't catch control-C
+   read flags from BZIP2 and BZIP environment variables
+   decline to break hard links to a file unless forced with -f
+   allow -c flag even with no filenames
+   preserve file ownerships as far as possible
+   make -s -1 give the expected block size (100k)
+   add a flag -q --quiet to suppress nonessential warnings
+   stop decoding flags after --, so files beginning in - can be handled
+   resolved inconsistent naming: bzcat or bz2cat ?
+   bzip2 --help now returns 0
+
+Programming-level changes are:
+
+   fixed syntax error in GET_LL4 for Borland C++ 5.02
+   let bzBuffToBuffDecompress return BZ_DATA_ERROR{_MAGIC}
+   fix overshoot of mode-string end in bzopen_or_bzdopen
+   wrapped bzlib.h in #ifdef __cplusplus ... extern "C" { ... }
+   close file handles under all error conditions
+   added minor mods so it compiles with DJGPP out of the box
+   fixed Makefile so it doesn't give problems with BSD make
+   fix uninitialised memory reads in dlltest.c
+
+Summary:
+
+   * Compression speed is much less sensitive to the input
+     data than in previous versions.  Specifically, the very
+     slow performance caused by repetitive data is fixed.
+   * Many small improvements in file and flag handling.
+   * A Y2K statement.
+
+
+## 0.9.0c
+
+Fixed some problems in the library pertaining to some boundary cases.
+This makes the library behave more correctly in those situations.  The
+fixes apply only to features (calls and parameters) not used by
+bzip2.c, so the non-fixedness of them in previous versions has no
+effect on reliability of bzip2.c.
+
+In bzlib.c:
+   * made zero-length BZ_FLUSH work correctly in bzCompress().
+   * fixed bzWrite/bzRead to ignore zero-length requests.
+   * fixed bzread to correctly handle read requests after EOF.
+   * wrong parameter order in call to bzDecompressInit in
+     bzBuffToBuffDecompress.  Fixed.
+
+In compress.c:
+   * changed setting of nGroups in sendMTFValues() so as to
+     do a bit better on small files.  This _does_ effect
+     bzip2.c.
+
+
+## 0.9.0b
+
+Fixed a problem with error reporting in bzip2.c.  This does not effect
+the library in any way.  Problem is: versions 0.9.0 and 0.9.0a (of the
+program proper) compress and decompress correctly, but give misleading
+error messages (internal panics) when an I/O error occurs, instead of
+reporting the problem correctly.  This shouldn't give any data loss
+(as far as I can see), but is confusing.
+
+Made the inline declarations disappear for non-GCC compilers.
+
+
+## 0.9.0a
+
+Removed 'ranlib' from Makefile, since most modern Unix-es
+don't need it, or even know about it.
+
+
+## 0.9.0
+
+First version after 0.1pl2.
+
+   * Approx 10% faster compression, 30% faster decompression
+   * -t (test mode) is a lot quicker
+   * Can decompress concatenated compressed files
+   * Programming interface, so programs can directly read/write .bz2 files
+   * Less restrictive (BSD-style) licensing
+   * Flag handling more compatible with GNU gzip
+   * Much more documentation, i.e., a proper user manual
+   * Hopefully, improved portability (at least of the library)
+
+
+
+ ------------------------------------------------------------------
+ This file is part of bzip2/libbzip2, a program and library for
+ lossless, block-sorting data compression.
+
+ bzip2/libbzip2 version 1.1.0 of 6 September 2010
+ Copyright (C) 1996-2010 Julian Seward <[email protected]>
+
+ Please read the WARNING, DISCLAIMER and PATENTS sections in the
+ README file.
+
+ This program is released under the terms of the license contained
+ in the file LICENSE.
+ ------------------------------------------------------------------

+ 4 - 4
bzip2.mod/bzip2/README.XML.STUFF

@@ -2,10 +2,10 @@
   This file is part of bzip2/libbzip2, a program and library for
   lossless, block-sorting data compression.
 
-  bzip2/libbzip2 version 1.0.6 of 6 September 2010
+  bzip2/libbzip2 version 1.1.0 of 6 September 2010
   Copyright (C) 1996-2010 Julian Seward <[email protected]>
 
-  Please read the WARNING, DISCLAIMER and PATENTS sections in the 
+  Please read the WARNING, DISCLAIMER and PATENTS sections in the
   README file.
 
   This program is released under the terms of the license contained
@@ -15,7 +15,7 @@
 The script xmlproc.sh takes an xml file as input,
 and processes it to create .pdf, .html or .ps output.
 It uses format.pl, a perl script to format <pre> blocks nicely,
- and add CDATA tags so writers do not have to use eg. &lt; 
+ and add CDATA tags so writers do not have to use eg. &lt;
 
 The file "entities.xml" must be edited to reflect current
 version, year, etc.
@@ -36,7 +36,7 @@ Usage:
   Output: manual.ps
 
 
-Notum bene: 
+Notum bene:
 - pdfxmltex barfs if given a filename with an underscore in it
 
 - xmltex won't work yet - there's a bug in passivetex

+ 69 - 69
bzip2.mod/bzip2/README.md

@@ -1,23 +1,26 @@
 Bzip2
 =====
 
-This Bzip2/libbz2, a program and library for lossless, block-sorting
-data compression.
+This is Bzip2/libbz2; a program and library for lossless, block-sorting data
+compression.
+
+This document pertains to the Bzip2 feature development effort hosted on
+[GitLab.com](https://gitlab.com/bzip2/bzip2).
+
+The documentation here may differ from that on the Bzip2 1.0.x project page
+maintained by Mark Wielaard on[sourceware.org](https://sourceware.org/bzip2/).
 
 Copyright (C) 1996-2010 Julian Seward <[email protected]>
 
-Copyright (C) 2019 Federico Mena Quintero <[email protected]>
+Copyright (C) 2019-2020 Federico Mena Quintero <[email protected]>
 
-Please read the [WARNING], [DISCLAIMER] and [PATENTS] sections in this
-file for important information.
+Copyright (C) 2021 [Micah Snyder](https://gitlab.com/micahsnyder).
 
-This program is released under the terms of the license contained
-in the file [COPYING].
+Please read the [WARNING](#warning), [DISCLAIMER](#disclaimer) and
+[PATENTS](#patents) sections in this file for important information.
 
-[WARNING]: #warning
-[DISCLAIMER]: #disclaimer
-[PATENTS]: #patents
-[COPYING]: COPYING
+This program is released under the terms of the license contained in the
+[COPYING](COPYING) file.
 
 ------------------------------------------------------------------
 
@@ -27,94 +30,91 @@ Complete documentation is available in Postscript form (manual.ps),
 PDF (manual.pdf) or HTML (manual.html).  A plain-text version of the
 manual page is available as bzip2.txt.
 
+## Community Code of Conduct
+
+There is a code of conduct for contributors to Bzip2/libbz2.
+Please see the [`code-of-conduct.md`](code-of-conduct.md) file.
+
 ## Contributing to Bzip2's development
 
-There is a code of conduct for contributors to Bzip2/libbz2; please
-see the file [`code-of-conduct.md`][coc].
+The Bzip2 project is hosted on GitLab for feature development work.
+It can be found at https://gitlab.com/bzip2/bzip2
 
-Bzip2's source repository is at gitlab.com.  You can view the web
-interface here:
+Changes to be included in the next feature version are committed to the
+`master` branch.
 
-https://gitlab.com/federicomenaquintero/bzip2
+Feature releases are maintained in `release/*` branches.
 
-Maintenance happens in the `master` branch.  There is an effort to port
-Bzip2 gradually to [Rust] in a `rustify` branch.
+Long-term feature and experimental development will occur in feature branches.
+*Feature branches are unstable.* Feature branches may be rebased and force-
+pushed on occasion to keep them up-to-date and to resolve merge conflicts.
 
-To report bugs, or to view existing reports, please do so in [Bzip2's
-repository][gitlab] as well.
+The `rustify` branch is a feature branch that represents an effort to
+gradually port Bzip2 to [Rust](https://www.rust-lang.org).
 
-[coc]: code-of-conduct.md
-[gitlab]: https://gitlab.com/federicomenaquintero/bzip2/issues
-[Rust]: https://www.rust-lang.org
+## Report a Bug
 
+Please report bugs via [GitLab Issues](https://gitlab.com/bzip2/bzip2/issues).
 
-## Compiling Bzip2 and libbz2
+Before you create a new issue, please verify that no one else has already
+reported the same issue.
 
-Please see the [`COMPILING.md`][COMPILING.md] file for details.  This includes
-instructions for buliding using Meson, CMake, or nmake.
+## Compiling Bzip2 and libbz2
 
-[COMPILING.md]: COMPILING.md
+Please see the [`COMPILING.md`](COMPILING.md) file for details.
+This includes instructions for building using Meson, CMake, or nmake.
 
 ## WARNING
 
-This program and library (attempts to) compress data by
-performing several non-trivial transformations on it.
-Unless you are 100% familiar with *all* the algorithms contained
-herein, and with the consequences of modifying them, you should NOT
-meddle with the compression or decompression machinery.  Incorrect
-changes can and very likely *will* lead to disastrous loss of data.
+This program and library (attempts to) compress data by performing several
+non-trivial transformations on it. Unless you are 100% familiar with *all* the
+algorithms contained herein, and with the consequences of modifying them, you
+should NOT meddle with the compression or decompression machinery.
+Incorrect changes can and very likely *will* lead to disastrous loss of data.
 
 **Please contact the maintainers if you want to modify the algorithms.**
 
 ## DISCLAIMER
 
-**I TAKE NO RESPONSIBILITY FOR ANY LOSS OF DATA ARISING FROM THE
-USE OF THIS PROGRAM/LIBRARY, HOWSOEVER CAUSED.**
+**I TAKE NO RESPONSIBILITY FOR ANY LOSS OF DATA ARISING FROM THE USE OF THIS
+PROGRAM/LIBRARY, HOWSOEVER CAUSED.**
+
+Every compression of a file implies an assumption that the compressed file can
+be decompressed to reproduce the original. Great efforts in design, coding and
+testing have been made to ensure that this program works correctly.
 
-Every compression of a file implies an assumption that the
-compressed file can be decompressed to reproduce the original.
-Great efforts in design, coding and testing have been made to
-ensure that this program works correctly.  However, the complexity
-of the algorithms, and, in particular, the presence of various
-special cases in the code which occur with very low but non-zero
-probability make it impossible to rule out the possibility of bugs
-remaining in the program.  DO NOT COMPRESS ANY DATA WITH THIS
-PROGRAM UNLESS YOU ARE PREPARED TO ACCEPT THE POSSIBILITY, HOWEVER
-SMALL, THAT THE DATA WILL NOT BE RECOVERABLE.
+However, the complexity of the algorithms, and, in particular, the presence of
+various special cases in the code which occur with very low but non-zero
+probability make it impossible to rule out the possibility of bugs remaining in
+the program.
+
+DO NOT COMPRESS ANY DATA WITH THIS PROGRAM UNLESS YOU ARE PREPARED TO ACCEPT
+THE POSSIBILITY, HOWEVER SMALL, THAT THE DATA WILL NOT BE RECOVERABLE.
 
 That is not to say this program is inherently unreliable.
-Indeed, I very much hope the opposite is true.  Bzip2/libbz2
-has been carefully constructed and extensively tested.
+Indeed, I very much hope the opposite is true.
+Bzip2/libbz2 has been carefully constructed and extensively tested.
 
 ## PATENTS
 
-To the best of my knowledge, Bzip2/libbz2 does not use any patented
-algorithms.  However, I do not have the resources to carry out a
-patent search.  Therefore I cannot give any guarantee of the above
-statement.
+To the best of my knowledge, Bzip2/libbz2 does not use any patented algorithms.
+However, I do not have the resources to carry out a patent search.
+Therefore I cannot give any guarantee of the above statement.
 
 ## Maintainers
 
-Since June 2019, the maintainer of Bzip2/libbz2 is [Federico Mena
-Quintero][federico].  Feel free to contact me for any questions you
-may have about Bzip2, both its usage and its development.  You can
-contact me in the following ways:
-
-* [Mail me][mail] at [email protected].
+As of June 2021, [Micah Snyder](https://gitlab.com/micahsnyder) is the
+maintainer of Bzip2/libbz2 for feature development work (I.e. versions 1.1+).
 
-* IRC: I am `federico` on `irc.gnome.org` in the `#rust` or
-  `#gnome-hackers` channels.  I'm there most weekdays (Mon-Fri)
-  starting at about UTC 14:00 (that's 08:00 my time; I am in the UTC-6
-  timezone).  If this is not a convenient time for you, feel free to
-  [mail me][mail] and we can arrange a time.
+The Bzip2 feature development project is hosted on GitLab and can be found at
+https://gitlab.com/bzip2/bzip2
 
-[mail]: mailto:[email protected]
-[federico]: https://people.gnome.org/~federico/
+Bzip2 version 1.0 is maintained by [Mark Wielaard](https://www.klomp.org/mark/)
+at Sourceware and can be found at https://sourceware.org/git/?p=bzip2.git
 
 ### Special thanks
 
-Federico would like to thank Julian Seward, the original author of
-Bzip2/libbz2, for creating the program and making it a very compelling
-alternative to previous compression programs back in the early
-2000's.  Thanks to Julian also for letting Federico carry on with the
-maintainership of the program.
+Thanks to Julian Seward, the original author of Bzip2/libbz2, for creating the
+program and making it a very compelling alternative to previous compression
+programs back in the early 2000's. Thanks to Julian also for letting Federico,
+Mark, and Micah carry on with the maintainership of the program.

+ 68 - 68
bzip2.mod/bzip2/blocksort.c

@@ -8,10 +8,10 @@
    This file is part of bzip2/libbzip2, a program and library for
    lossless, block-sorting data compression.
 
-   bzip2/libbzip2 version 1.0.6 of 6 September 2010
+   bzip2/libbzip2 version 1.1.0 of 6 September 2010
    Copyright (C) 1996-2010 Julian Seward <[email protected]>
 
-   Please read the WARNING, DISCLAIMER and PATENTS sections in the 
+   Please read the WARNING, DISCLAIMER and PATENTS sections in the
    README file.
 
    This program is released under the terms of the license contained
@@ -27,11 +27,11 @@
 /*---------------------------------------------*/
 
 /*---------------------------------------------*/
-static 
+static
 __inline__
-void fallbackSimpleSort ( UInt32* fmap, 
-                          UInt32* eclass, 
-                          Int32   lo, 
+void fallbackSimpleSort ( UInt32* fmap,
+                          UInt32* eclass,
+                          Int32   lo,
                           Int32   hi )
 {
    Int32 i, j, tmp;
@@ -90,9 +90,9 @@ void fallbackSimpleSort ( UInt32* fmap,
 
 
 static
-void fallbackQSort3 ( UInt32* fmap, 
+void fallbackQSort3 ( UInt32* fmap,
                       UInt32* eclass,
-                      Int32   loSt, 
+                      Int32   loSt,
                       Int32   hiSt )
 {
    Int32 unLo, unHi, ltLo, gtHi, n, m;
@@ -117,9 +117,9 @@ void fallbackQSort3 ( UInt32* fmap,
       }
 
       /* Random partitioning.  Median of 3 sometimes fails to
-         avoid bad cases.  Median of 9 seems to help but 
+         avoid bad cases.  Median of 9 seems to help but
          looks rather expensive.  This too seems to work but
-         is cheaper.  Guidance for the magic constants 
+         is cheaper.  Guidance for the magic constants
          7621 and 32768 is taken from Sedgewick's algorithms
          book, chapter 35.
       */
@@ -136,10 +136,10 @@ void fallbackQSort3 ( UInt32* fmap,
          while (1) {
             if (unLo > unHi) break;
             n = (Int32)eclass[fmap[unLo]] - (Int32)med;
-            if (n == 0) { 
-               fswap(fmap[unLo], fmap[ltLo]); 
-               ltLo++; unLo++; 
-               continue; 
+            if (n == 0) {
+               fswap(fmap[unLo], fmap[ltLo]);
+               ltLo++; unLo++;
+               continue;
             };
             if (n > 0) break;
             unLo++;
@@ -147,10 +147,10 @@ void fallbackQSort3 ( UInt32* fmap,
          while (1) {
             if (unLo > unHi) break;
             n = (Int32)eclass[fmap[unHi]] - (Int32)med;
-            if (n == 0) { 
-               fswap(fmap[unHi], fmap[gtHi]); 
-               gtHi--; unHi--; 
-               continue; 
+            if (n == 0) {
+               fswap(fmap[unHi], fmap[gtHi]);
+               gtHi--; unHi--;
+               continue;
             };
             if (n < 0) break;
             unHi--;
@@ -209,8 +209,8 @@ void fallbackQSort3 ( UInt32* fmap,
 #define UNALIGNED_BH(zz)  ((zz) & 0x01f)
 
 static
-void fallbackSort ( UInt32* fmap, 
-                    UInt32* eclass, 
+void fallbackSort ( UInt32* fmap,
+                    UInt32* eclass,
                     UInt32* bhtab,
                     Int32   nblock,
                     Int32   verb )
@@ -251,7 +251,7 @@ void fallbackSort ( UInt32* fmap,
    --*/
 
    /*-- set sentinel bits for block-end detection --*/
-   for (i = 0; i < 32; i++) { 
+   for (i = 0; i < 32; i++) {
       SET_BH(nblock + 2*i);
       CLEAR_BH(nblock + 2*i + 1);
    }
@@ -260,7 +260,7 @@ void fallbackSort ( UInt32* fmap,
    H = 1;
    while (1) {
 
-      if (verb >= 4) 
+      if (verb >= 4)
          VPrintf1 ( "        depth %6d has ", H );
 
       j = 0;
@@ -274,7 +274,7 @@ void fallbackSort ( UInt32* fmap,
       r = -1;
       while (1) {
 
-	 /*-- find the next non-singleton bucket --*/
+         /*-- find the next non-singleton bucket --*/
          k = r + 1;
          while (ISSET_BH(k) && UNALIGNED_BH(k)) k++;
          if (ISSET_BH(k)) {
@@ -305,14 +305,14 @@ void fallbackSort ( UInt32* fmap,
          }
       }
 
-      if (verb >= 4) 
+      if (verb >= 4)
          VPrintf1 ( "%6d unresolved strings\n", nNotDone );
 
       H *= 2;
       if (H > nblock || nNotDone == 0) break;
    }
 
-   /*-- 
+   /*--
       Reconstruct the original block in
       eclass8 [0 .. nblock-1], since the
       previous phase destroyed it.
@@ -344,9 +344,9 @@ void fallbackSort ( UInt32* fmap,
 /*---------------------------------------------*/
 static
 __inline__
-Bool mainGtU ( UInt32  i1, 
+Bool mainGtU ( UInt32  i1,
                UInt32  i2,
-               UChar*  block, 
+               UChar*  block,
                UInt16* quadrant,
                UInt32  nblock,
                Int32*  budget )
@@ -486,8 +486,8 @@ void mainSimpleSort ( UInt32* ptr,
                       UChar*  block,
                       UInt16* quadrant,
                       Int32   nblock,
-                      Int32   lo, 
-                      Int32   hi, 
+                      Int32   lo,
+                      Int32   hi,
                       Int32   d,
                       Int32*  budget )
 {
@@ -511,8 +511,8 @@ void mainSimpleSort ( UInt32* ptr,
          if (i > hi) break;
          v = ptr[i];
          j = i;
-         while ( mainGtU ( 
-                    ptr[j-h]+d, v+d, block, quadrant, nblock, budget 
+         while ( mainGtU (
+                    ptr[j-h]+d, v+d, block, quadrant, nblock, budget
                  ) ) {
             ptr[j] = ptr[j-h];
             j = j - h;
@@ -525,8 +525,8 @@ void mainSimpleSort ( UInt32* ptr,
          if (i > hi) break;
          v = ptr[i];
          j = i;
-         while ( mainGtU ( 
-                    ptr[j-h]+d, v+d, block, quadrant, nblock, budget 
+         while ( mainGtU (
+                    ptr[j-h]+d, v+d, block, quadrant, nblock, budget
                  ) ) {
             ptr[j] = ptr[j-h];
             j = j - h;
@@ -539,8 +539,8 @@ void mainSimpleSort ( UInt32* ptr,
          if (i > hi) break;
          v = ptr[i];
          j = i;
-         while ( mainGtU ( 
-                    ptr[j-h]+d, v+d, block, quadrant, nblock, budget 
+         while ( mainGtU (
+                    ptr[j-h]+d, v+d, block, quadrant, nblock, budget
                  ) ) {
             ptr[j] = ptr[j-h];
             j = j - h;
@@ -578,13 +578,13 @@ void mainSimpleSort ( UInt32* ptr,
    }                                  \
 }
 
-static 
+static
 __inline__
 UChar mmed3 ( UChar a, UChar b, UChar c )
 {
    UChar t;
    if (a > b) { t = a; a = b; b = t; };
-   if (b > c) { 
+   if (b > c) {
       b = c;
       if (a > b) b = a;
    }
@@ -622,8 +622,8 @@ void mainQSort3 ( UInt32* ptr,
                   UChar*  block,
                   UInt16* quadrant,
                   Int32   nblock,
-                  Int32   loSt, 
-                  Int32   hiSt, 
+                  Int32   loSt,
+                  Int32   hiSt,
                   Int32   dSt,
                   Int32*  budget )
 {
@@ -646,14 +646,14 @@ void mainQSort3 ( UInt32* ptr,
       AssertH ( sp < MAIN_QSORT_STACK_SIZE - 2, 1001 );
 
       mpop ( lo, hi, d );
-      if (hi - lo < MAIN_QSORT_SMALL_THRESH || 
+      if (hi - lo < MAIN_QSORT_SMALL_THRESH ||
           d > MAIN_QSORT_DEPTH_THRESH) {
          mainSimpleSort ( ptr, block, quadrant, nblock, lo, hi, d, budget );
          if (*budget < 0) return;
          continue;
       }
 
-      med = (Int32) 
+      med = (Int32)
             mmed3 ( block[ptr[ lo         ]+d],
                     block[ptr[ hi         ]+d],
                     block[ptr[ (lo+hi)>>1 ]+d] );
@@ -665,9 +665,9 @@ void mainQSort3 ( UInt32* ptr,
          while (True) {
             if (unLo > unHi) break;
             n = ((Int32)block[ptr[unLo]+d]) - med;
-            if (n == 0) { 
-               mswap(ptr[unLo], ptr[ltLo]); 
-               ltLo++; unLo++; continue; 
+            if (n == 0) {
+               mswap(ptr[unLo], ptr[ltLo]);
+               ltLo++; unLo++; continue;
             };
             if (n >  0) break;
             unLo++;
@@ -675,9 +675,9 @@ void mainQSort3 ( UInt32* ptr,
          while (True) {
             if (unLo > unHi) break;
             n = ((Int32)block[ptr[unHi]+d]) - med;
-            if (n == 0) { 
-               mswap(ptr[unHi], ptr[gtHi]); 
-               gtHi--; unHi--; continue; 
+            if (n == 0) {
+               mswap(ptr[unHi], ptr[gtHi]);
+               gtHi--; unHi--; continue;
             };
             if (n <  0) break;
             unHi--;
@@ -748,9 +748,9 @@ void mainQSort3 ( UInt32* ptr,
 #define CLEARMASK (~(SETMASK))
 
 static
-void mainSort ( UInt32* ptr, 
+void mainSort ( UInt32* ptr,
                 UChar*  block,
-                UInt16* quadrant, 
+                UInt16* quadrant,
                 UInt32* ftab,
                 Int32   nblock,
                 Int32   verb,
@@ -878,7 +878,7 @@ void mainSort ( UInt32* ptr,
       /*--
          Step 1:
          Complete the big bucket [ss] by quicksorting
-         any unsorted small buckets [ss, j], for j != ss.  
+         any unsorted small buckets [ss, j], for j != ss.
          Hopefully previous pointer-scanning phases have already
          completed many of the small buckets [ss, j], so
          we don't have to sort them at all.
@@ -894,10 +894,10 @@ void mainSort ( UInt32* ptr,
                      VPrintf4 ( "        qsort [0x%x, 0x%x]   "
                                 "done %d   this %d\n",
                                 ss, j, numQSorted, hi - lo + 1 );
-                  mainQSort3 ( 
-                     ptr, block, quadrant, nblock, 
-                     lo, hi, BZ_N_RADIX, budget 
-                  );   
+                  mainQSort3 (
+                     ptr, block, quadrant, nblock,
+                     lo, hi, BZ_N_RADIX, budget
+                  );
                   numQSorted += (hi - lo + 1);
                   if (*budget < 0) return;
                }
@@ -929,16 +929,16 @@ void mainSort ( UInt32* ptr,
          for (j = (ftab[(ss+1) << 8] & CLEARMASK) - 1; j > copyEnd[ss]; j--) {
             k = ptr[j]-1; if (k < 0) k += nblock;
             c1 = block[k];
-            if (!bigDone[c1]) 
+            if (!bigDone[c1])
                ptr[ copyEnd[c1]-- ] = k;
          }
       }
 
       AssertH ( (copyStart[ss]-1 == copyEnd[ss])
-                || 
+                ||
                 /* Extremely rare case missing in bzip2-1.0.0 and 1.0.1.
-                   Necessity for this case is demonstrated by compressing 
-                   a sequence of approximately 48.5 million of character 
+                   Necessity for this case is demonstrated by compressing
+                   a sequence of approximately 48.5 million of character
                    251; 1.0.0/1.0.1 will then die here. */
                 (copyStart[ss] == 0 && copyEnd[ss] == nblock-1),
                 1007 )
@@ -955,7 +955,7 @@ void mainSort ( UInt32* ptr,
          updating for the last bucket is pointless.
 
          The quadrant array provides a way to incrementally
-         cache sort orderings, as they appear, so as to 
+         cache sort orderings, as they appear, so as to
          make subsequent comparisons in fullGtU() complete
          faster.  For repetitive blocks this makes a big
          difference (but not big enough to be able to avoid
@@ -965,9 +965,9 @@ void mainSort ( UInt32* ptr,
 
             for 0 <= i < nblock and 0 <= j <= nblock
 
-            if block[i] != block[j], 
+            if block[i] != block[j],
 
-               then the relative values of quadrant[i] and 
+               then the relative values of quadrant[i] and
                     quadrant[j] are meaningless.
 
                else {
@@ -1030,7 +1030,7 @@ void mainSort ( UInt32* ptr,
 */
 void BZ2_blockSort ( EState* s )
 {
-   UInt32* ptr    = s->ptr; 
+   UInt32* ptr    = s->ptr;
    UChar*  block  = s->block;
    UInt32* ftab   = s->ftab;
    Int32   nblock = s->nblock;
@@ -1054,8 +1054,8 @@ void BZ2_blockSort ( EState* s )
       quadrant = (UInt16*)(&(block[i]));
 
       /* (wfact-1) / 3 puts the default-factor-30
-         transition point at very roughly the same place as 
-         with v0.1 and v0.9.0.  
+         transition point at very roughly the same place as
+         with v0.1 and v0.9.0.
          Not that it particularly matters any more, since the
          resulting compressed stream is now the same regardless
          of whether or not we use the main sort or fallback sort.
@@ -1066,14 +1066,14 @@ void BZ2_blockSort ( EState* s )
       budget = budgetInit;
 
       mainSort ( ptr, block, quadrant, ftab, nblock, verb, &budget );
-      if (verb >= 3) 
+      if (verb >= 3)
          VPrintf3 ( "      %d work, %d block, ratio %5.2f\n",
                     budgetInit - budget,
-                    nblock, 
+                    nblock,
                     (float)(budgetInit - budget) /
-                    (float)(nblock==0 ? 1 : nblock) ); 
+                    (float)(nblock==0 ? 1 : nblock) );
       if (budget < 0) {
-         if (verb >= 2) 
+         if (verb >= 2)
             VPrintf0 ( "    too repetitive; using fallback"
                        " sorting algorithm\n" );
          fallbackSort ( s->arr1, s->arr2, ftab, nblock, verb );

+ 8 - 8
bzip2.mod/bzip2/bzdiff

@@ -37,10 +37,6 @@ if test -z "$FILES"; then
 	echo "Usage: $prog [${comp}_options] file [file]"
 	exit 1
 fi
-tmp=`mktemp ${TMPDIR:-/tmp}/bzdiff.XXXXXXXXXX` || {
-      echo 'cannot create a temporary file' >&2
-      exit 1
-}
 set $FILES
 if test $# -eq 1; then
 	FILE=`echo "$1" | sed 's/.bz2$//'`
@@ -53,10 +49,14 @@ elif test $# -eq 2; then
                 case "$2" in
 	        *.bz2)
 			F=`echo "$2" | sed 's|.*/||;s|.bz2$||'`
-                        bzip2 -cdfq "$2" > $tmp
-                        bzip2 -cdfq "$1" | $comp $OPTIONS - $tmp
+			tmp=`mktemp "${TMPDIR:-/tmp}"/bzdiff.XXXXXXXXXX` || {
+			      echo 'cannot create a temporary file' >&2
+			      exit 1
+			}
+                        bzip2 -cdfq "$2" > "$tmp"
+                        bzip2 -cdfq "$1" | $comp $OPTIONS - "$tmp"
                         STAT="$?"
-			/bin/rm -f $tmp;;
+			/bin/rm -f "$tmp";;
 
                 *)      bzip2 -cdfq "$1" | $comp $OPTIONS - "$2"
                         STAT="$?";;
@@ -69,8 +69,8 @@ elif test $# -eq 2; then
                         STAT="$?";;
                 esac;;
 	esac
-        exit "$STAT"
 else
 	echo "Usage: $prog [${comp}_options] file [file]"
 	exit 1
 fi
+exit "$STAT"

+ 3 - 3
bzip2.mod/bzip2/bzgrep

@@ -10,8 +10,8 @@ PATH="/usr/bin:$PATH"; export PATH
 
 prog=`echo $0 | sed 's|.*/||'`
 case "$prog" in
-	*egrep)	grep=${EGREP-egrep}	;;
-	*fgrep)	grep=${FGREP-fgrep}	;;
+	*egrep)	grep=${EGREP-grep -E}	;;
+	*fgrep)	grep=${FGREP-grep -F}	;;
 	*)	grep=${GREP-grep}	;;
 esac
 pat=""
@@ -19,7 +19,7 @@ while test $# -ne 0; do
   case "$1" in
   -e | -f) opt="$opt $1"; shift; pat="$1"
            if test "$grep" = grep; then  # grep is buggy with -e on SVR4
-             grep=egrep
+             grep="grep -E"
            fi;;
   -A | -B) opt="$opt $1 $2"; shift;;
   -*)	   opt="$opt $1";;

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 203 - 210
bzip2.mod/bzip2/bzip2.c


+ 3 - 3
bzip2.mod/bzip2/bzip2.doap

@@ -12,9 +12,9 @@
     as a component of compressed data streams.
   </description>
 
-  <homepage rdf:resource="https://sourceware.org/bzip2/" />
-  <download-page rdf:resource="https://sourceware.org/bzip2/downloads.html/" />
-  <bug-database rdf:resource="https://gitlab.com/federicomenaquintero/bzip2/issues" />
+  <homepage rdf:resource="https://gitlab.com/bzip2/bzip2" />
+  <download-page rdf:resource="https://gitlab.com/bzip2/bzip2/-/tags" />
+  <bug-database rdf:resource="https://gitlab.com/bzip2/bzip2/issues" />
   <programming-language>C</programming-language>
   <programming-language>Rust</programming-language>
 

+ 2 - 3
bzip2.mod/bzip2/bzip2.txt

@@ -345,7 +345,7 @@ CAVEATS
        but  the  details  of  what  the problem is sometimes seem
        rather misleading.
 
-       This manual page pertains to version 1.0.6 of bzip2.  Com-
+       This manual page pertains to version 1.1.0 of bzip2.  Com-
        pressed  data created by this version is entirely forwards
        and  backwards  compatible  with   the   previous   public
        releases,  versions  0.1pl2,  0.9.0,  0.9.5, 1.0.0, 1.0.1,
@@ -369,7 +369,7 @@ CAVEATS
 AUTHOR
        Julian Seward, [email protected]
 
-       https://sourceware.org/bzip2/
+       https://gitlab.com/bzip2/bzip2
 
        The ideas embodied in bzip2 are due to (at least) the fol-
        lowing  people: Michael Burrows and David Wheeler (for the
@@ -388,4 +388,3 @@ AUTHOR
        gzip.  Many people sent patches, helped  with  portability
        problems,  lent  machines,  gave advice and were generally
        helpful.
-

+ 25 - 31
bzip2.mod/bzip2/bzip2recover.c

@@ -7,10 +7,10 @@
    This file is part of bzip2/libbzip2, a program and library for
    lossless, block-sorting data compression.
 
-   bzip2/libbzip2 version 1.0.6 of 6 September 2010
+   bzip2/libbzip2 version 1.1.0 of 6 September 2010
    Copyright (C) 1996-2010 Julian Seward <[email protected]>
 
-   Please read the WARNING, DISCLAIMER and PATENTS sections in the 
+   Please read the WARNING, DISCLAIMER and PATENTS sections in the
    README file.
 
    This program is released under the terms of the license contained
@@ -18,14 +18,8 @@
    ------------------------------------------------------------------ */
 
 /* This program is a complete hack and should be rewritten properly.
-	 It isn't very complicated. */
+   It isn't very complicated. */
 
-/* Place a 1 beside your platform, and 0 elsewhere.
-   Generic 32-bit Unix.
-   Also works on 64-bit Unix boxes.
-   This is the default.
-*/
-#define BZ_UNIX      1
 #if BZ_UNIX
 #   include <fcntl.h>
 #   include <sys/types.h>
@@ -88,7 +82,7 @@ MaybeUInt64 bytesIn  = 0;
 #define BZ_HDR_Z 0x5a                         /* 'Z' */
 #define BZ_HDR_h 0x68                         /* 'h' */
 #define BZ_HDR_0 0x30                         /* '0' */
- 
+
 
 /*---------------------------------------------------*/
 /*--- I/O errors                                  ---*/
@@ -141,7 +135,7 @@ static void tooManyBlocks ( Int32 max_handled_blocks )
    fprintf ( stderr,
              "%s: and cannot be handled.  To fix, increase\n",
              progName );
-   fprintf ( stderr, 
+   fprintf ( stderr,
              "%s: BZ_MAX_HANDLED_BLOCKS in bzip2recover.c, and recompile.\n",
              progName );
    exit ( 1 );
@@ -347,7 +341,7 @@ Int32 main ( Int32 argc, Char** argv )
    progName[BZ_MAX_FILENAME-1]='\0';
    inFileName[0] = outFileName[0] = 0;
 
-   fprintf ( stderr, 
+   fprintf ( stderr,
              "bzip2recover 1.0.6: extracts blocks from damaged .bz2 files.\n" );
 
    if (argc != 2) {
@@ -355,18 +349,18 @@ Int32 main ( Int32 argc, Char** argv )
                         progName, progName );
       switch (sizeof(MaybeUInt64)) {
          case 8:
-            fprintf(stderr, 
+            fprintf(stderr,
                     "\trestrictions on size of recovered file: None\n");
             break;
          case 4:
-            fprintf(stderr, 
+            fprintf(stderr,
                     "\trestrictions on size of recovered file: 512 MB\n");
-            fprintf(stderr, 
+            fprintf(stderr,
                     "\tto circumvent, recompile with MaybeUInt64 as an\n"
                     "\tunsigned 64-bit int.\n");
             break;
          default:
-            fprintf(stderr, 
+            fprintf(stderr,
                     "\tsizeof(MaybeUInt64) is not 4 or 8 -- "
                     "configuration error.\n");
             break;
@@ -375,7 +369,7 @@ Int32 main ( Int32 argc, Char** argv )
    }
 
    if (strlen(argv[1]) >= BZ_MAX_FILENAME-20) {
-      fprintf ( stderr, 
+      fprintf ( stderr,
                 "%s: supplied filename is suspiciously (>= %d chars) long.  Bye!\n",
                 progName, (int)strlen(argv[1]) );
       exit(1);
@@ -407,7 +401,7 @@ Int32 main ( Int32 argc, Char** argv )
             (bitsRead - bStart[currBlock]) >= 40) {
             bEnd[currBlock] = bitsRead-1;
             if (currBlock > 0)
-               fprintf ( stderr, "   block %d runs from " MaybeUInt64_FMT 
+               fprintf ( stderr, "   block %d runs from " MaybeUInt64_FMT
                                  " to " MaybeUInt64_FMT " (incomplete)\n",
                          currBlock,  bStart[currBlock], bEnd[currBlock] );
          } else
@@ -416,10 +410,10 @@ Int32 main ( Int32 argc, Char** argv )
       }
       buffHi = (buffHi << 1) | (buffLo >> 31);
       buffLo = (buffLo << 1) | (b & 1);
-      if ( ( (buffHi & 0x0000ffff) == BLOCK_HEADER_HI 
+      if ( ( (buffHi & 0x0000ffff) == BLOCK_HEADER_HI
              && buffLo == BLOCK_HEADER_LO)
-           || 
-           ( (buffHi & 0x0000ffff) == BLOCK_ENDMARK_HI 
+           ||
+           ( (buffHi & 0x0000ffff) == BLOCK_ENDMARK_HI
              && buffLo == BLOCK_ENDMARK_LO)
          ) {
          if (bitsRead > 49) {
@@ -428,8 +422,8 @@ Int32 main ( Int32 argc, Char** argv )
             bEnd[currBlock] = 0;
          }
          if (currBlock > 0 &&
-	     (bEnd[currBlock] - bStart[currBlock]) >= 130) {
-            fprintf ( stderr, "   block %d runs from " MaybeUInt64_FMT 
+             (bEnd[currBlock] - bStart[currBlock]) >= 130) {
+            fprintf ( stderr, "   block %d runs from " MaybeUInt64_FMT
                               " to " MaybeUInt64_FMT "\n",
                       rbCtr+1,  bStart[currBlock], bEnd[currBlock] );
             rbStart[rbCtr] = bStart[currBlock];
@@ -475,7 +469,7 @@ Int32 main ( Int32 argc, Char** argv )
       if (b == 2) break;
       buffHi = (buffHi << 1) | (buffLo >> 31);
       buffLo = (buffLo << 1) | (b & 1);
-      if (bitsRead == 47+rbStart[wrBlock]) 
+      if (bitsRead == 47+rbStart[wrBlock])
          blockCRC = (buffHi << 16) | (buffLo >> 16);
 
       if (outFile != NULL && bitsRead >= rbStart[wrBlock]
@@ -498,11 +492,11 @@ Int32 main ( Int32 argc, Char** argv )
          wrBlock++;
       } else
       if (bitsRead == rbStart[wrBlock]) {
-         /* Create the output file name, correctly handling leading paths. 
+         /* Create the output file name, correctly handling leading paths.
             (31.10.2001 by Sergey E. Kusikov) */
          Char* split;
          Int32 ofs, k;
-         for (k = 0; k < BZ_MAX_FILENAME; k++) 
+         for (k = 0; k < BZ_MAX_FILENAME; k++)
             outFileName[k] = 0;
          strcpy (outFileName, inFileName);
          split = strrchr (outFileName, BZ_SPLIT_SYM);
@@ -510,8 +504,8 @@ Int32 main ( Int32 argc, Char** argv )
             split = outFileName;
          } else {
             ++split;
-	 }
-	 /* Now split points to the start of the basename. */
+         }
+         /* Now split points to the start of the basename. */
          ofs  = split - outFileName;
          sprintf (split, "rec%5d", wrBlock+1);
          for (p = split; *p != 0; p++) if (*p == ' ') *p = '0';
@@ -529,9 +523,9 @@ Int32 main ( Int32 argc, Char** argv )
             exit(1);
          }
          bsWr = bsOpenWriteStream ( outFile );
-         bsPutUChar ( bsWr, BZ_HDR_B );    
-         bsPutUChar ( bsWr, BZ_HDR_Z );    
-         bsPutUChar ( bsWr, BZ_HDR_h );    
+         bsPutUChar ( bsWr, BZ_HDR_B );
+         bsPutUChar ( bsWr, BZ_HDR_Z );
+         bsPutUChar ( bsWr, BZ_HDR_h );
          bsPutUChar ( bsWr, BZ_HDR_0 + 9 );
          bsPutUChar ( bsWr, 0x31 ); bsPutUChar ( bsWr, 0x41 );
          bsPutUChar ( bsWr, 0x59 ); bsPutUChar ( bsWr, 0x26 );

+ 120 - 119
bzip2.mod/bzip2/bzlib.c

@@ -8,10 +8,10 @@
    This file is part of bzip2/libbzip2, a program and library for
    lossless, block-sorting data compression.
 
-   bzip2/libbzip2 version 1.0.6 of 6 September 2010
+   bzip2/libbzip2 version 1.1.0 of 6 September 2010
    Copyright (C) 1996-2010 Julian Seward <[email protected]>
 
-   Please read the WARNING, DISCLAIMER and PATENTS sections in the 
+   Please read the WARNING, DISCLAIMER and PATENTS sections in the
    README file.
 
    This program is released under the terms of the license contained
@@ -41,15 +41,16 @@
 #ifndef BZ_NO_STDIO
 void BZ2_bz__AssertH__fail ( int errcode )
 {
-   fprintf(stderr, 
+   fprintf(stderr,
       "\n\nbzip2/libbzip2: internal error number %d.\n"
       "This is a bug in bzip2/libbzip2, %s.\n"
-      "Please report it to me at: [email protected].  If this happened\n"
-      "when you were using some program which uses libbzip2 as a\n"
-      "component, you should also report this bug to the author(s)\n"
-      "of that program.  Please make an effort to report this bug;\n"
+      "Please report it at: https://gitlab.com/bzip2/bzip2/-/issues\n"
+      "If this happened when you were using some program which uses\n"
+      "libbzip2 as a component, you should also report this bug to\n"
+      "the author(s) of that program.\n"
+      "Please make an effort to report this bug;\n"
       "timely and accurate bug reports eventually lead to higher\n"
-      "quality software.  Thanks.  Julian Seward, 10 December 2007.\n\n",
+      "quality software.  Thanks.\n\n",
       errcode,
       BZ2_bzlibVersion()
    );
@@ -146,8 +147,8 @@ Bool isempty_RL ( EState* s )
 
 
 /*---------------------------------------------------*/
-int BZ_API(BZ2_bzCompressInit) 
-                    ( bz_stream* strm, 
+int BZ_API(BZ2_bzCompressInit)
+                    ( bz_stream* strm,
                      int        blockSize100k,
                      int        verbosity,
                      int        workFactor )
@@ -157,7 +158,7 @@ int BZ_API(BZ2_bzCompressInit)
 
    if (!bz_config_ok()) return BZ_CONFIG_ERROR;
 
-   if (strm == NULL || 
+   if (strm == NULL ||
        blockSize100k < 1 || blockSize100k > 9 ||
        workFactor < 0 || workFactor > 250)
      return BZ_PARAM_ERROR;
@@ -300,7 +301,7 @@ Bool copy_input_until_stop ( EState* s )
          /*-- no input? --*/
          if (s->strm->avail_in == 0) break;
          progress_in = True;
-         ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) ); 
+         ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) );
          s->strm->next_in++;
          s->strm->avail_in--;
          s->strm->total_in_lo32++;
@@ -318,7 +319,7 @@ Bool copy_input_until_stop ( EState* s )
          /*-- flush/finish end? --*/
          if (s->avail_in_expect == 0) break;
          progress_in = True;
-         ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) ); 
+         ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) );
          s->strm->next_in++;
          s->strm->avail_in--;
          s->strm->total_in_lo32++;
@@ -364,18 +365,18 @@ Bool handle_compress ( bz_stream* strm )
    Bool progress_in  = False;
    Bool progress_out = False;
    EState* s = strm->state;
-   
+
    while (True) {
 
       if (s->state == BZ_S_OUTPUT) {
          progress_out |= copy_output_until_stop ( s );
          if (s->state_out_pos < s->numZ) break;
-         if (s->mode == BZ_M_FINISHING && 
+         if (s->mode == BZ_M_FINISHING &&
              s->avail_in_expect == 0 &&
              isempty_RL(s)) break;
          prepare_new_block ( s );
          s->state = BZ_S_INPUT;
-         if (s->mode == BZ_M_FLUSHING && 
+         if (s->mode == BZ_M_FLUSHING &&
              s->avail_in_expect == 0 &&
              isempty_RL(s)) break;
       }
@@ -424,9 +425,9 @@ int BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action )
          if (action == BZ_RUN) {
             progress = handle_compress ( strm );
             return progress ? BZ_RUN_OK : BZ_PARAM_ERROR;
-         } 
+         }
          else
-	 if (action == BZ_FLUSH) {
+         if (action == BZ_FLUSH) {
             s->avail_in_expect = strm->avail_in;
             s->mode = BZ_M_FLUSHING;
             goto preswitch;
@@ -437,12 +438,12 @@ int BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action )
             s->mode = BZ_M_FINISHING;
             goto preswitch;
          }
-         else 
+         else
             return BZ_PARAM_ERROR;
 
       case BZ_M_FLUSHING:
          if (action != BZ_FLUSH) return BZ_SEQUENCE_ERROR;
-         if (s->avail_in_expect != s->strm->avail_in) 
+         if (s->avail_in_expect != s->strm->avail_in)
             return BZ_SEQUENCE_ERROR;
          progress = handle_compress ( strm );
          if (s->avail_in_expect > 0 || !isempty_RL(s) ||
@@ -452,7 +453,7 @@ int BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action )
 
       case BZ_M_FINISHING:
          if (action != BZ_FINISH) return BZ_SEQUENCE_ERROR;
-         if (s->avail_in_expect != s->strm->avail_in) 
+         if (s->avail_in_expect != s->strm->avail_in)
             return BZ_SEQUENCE_ERROR;
          progress = handle_compress ( strm );
          if (!progress) return BZ_SEQUENCE_ERROR;
@@ -479,7 +480,7 @@ int BZ_API(BZ2_bzCompressEnd)  ( bz_stream *strm )
    if (s->ftab != NULL) BZFREE(s->ftab);
    BZFREE(strm->state);
 
-   strm->state = NULL;   
+   strm->state = NULL;
 
    return BZ_OK;
 }
@@ -490,8 +491,8 @@ int BZ_API(BZ2_bzCompressEnd)  ( bz_stream *strm )
 /*---------------------------------------------------*/
 
 /*---------------------------------------------------*/
-int BZ_API(BZ2_bzDecompressInit) 
-                     ( bz_stream* strm, 
+int BZ_API(BZ2_bzDecompressInit)
+                     ( bz_stream* strm,
                        int        verbosity,
                        int        small )
 {
@@ -556,34 +557,34 @@ Bool unRLE_obuf_to_output_FAST ( DState* s )
 
          /* can a new run be started? */
          if (s->nblock_used == s->save_nblock+1) return False;
-               
+
          /* Only caused by corrupt data stream? */
          if (s->nblock_used > s->save_nblock+1)
             return True;
-   
+
          s->state_out_len = 1;
          s->state_out_ch = s->k0;
-         BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; 
+         BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
          k1 ^= BZ_RAND_MASK; s->nblock_used++;
          if (s->nblock_used == s->save_nblock+1) continue;
          if (k1 != s->k0) { s->k0 = k1; continue; };
-   
+
          s->state_out_len = 2;
-         BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; 
+         BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
          k1 ^= BZ_RAND_MASK; s->nblock_used++;
          if (s->nblock_used == s->save_nblock+1) continue;
          if (k1 != s->k0) { s->k0 = k1; continue; };
-   
+
          s->state_out_len = 3;
-         BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; 
+         BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
          k1 ^= BZ_RAND_MASK; s->nblock_used++;
          if (s->nblock_used == s->save_nblock+1) continue;
          if (k1 != s->k0) { s->k0 = k1; continue; };
-   
-         BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; 
+
+         BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
          k1 ^= BZ_RAND_MASK; s->nblock_used++;
          s->state_out_len = ((Int32)k1) + 4;
-         BZ_GET_FAST(s->k0); BZ_RAND_UPD_MASK; 
+         BZ_GET_FAST(s->k0); BZ_RAND_UPD_MASK;
          s->k0 ^= BZ_RAND_MASK; s->nblock_used++;
       }
 
@@ -621,7 +622,7 @@ Bool unRLE_obuf_to_output_FAST ( DState* s )
             }
             s_state_out_len_eq_one:
             {
-               if (cs_avail_out == 0) { 
+               if (cs_avail_out == 0) {
                   c_state_out_len = 1; goto return_notr;
                };
                *( (UChar*)(cs_next_out) ) = c_state_out_ch;
@@ -629,7 +630,7 @@ Bool unRLE_obuf_to_output_FAST ( DState* s )
                cs_next_out++;
                cs_avail_out--;
             }
-         }   
+         }
          /* Only caused by corrupt data stream? */
          if (c_nblock_used > s_save_nblockPP)
             return True;
@@ -637,25 +638,25 @@ Bool unRLE_obuf_to_output_FAST ( DState* s )
          /* can a new run be started? */
          if (c_nblock_used == s_save_nblockPP) {
             c_state_out_len = 0; goto return_notr;
-         };   
+         };
          c_state_out_ch = c_k0;
          BZ_GET_FAST_C(k1); c_nblock_used++;
-         if (k1 != c_k0) { 
-            c_k0 = k1; goto s_state_out_len_eq_one; 
+         if (k1 != c_k0) {
+            c_k0 = k1; goto s_state_out_len_eq_one;
          };
-         if (c_nblock_used == s_save_nblockPP) 
+         if (c_nblock_used == s_save_nblockPP)
             goto s_state_out_len_eq_one;
-   
+
          c_state_out_len = 2;
          BZ_GET_FAST_C(k1); c_nblock_used++;
          if (c_nblock_used == s_save_nblockPP) continue;
          if (k1 != c_k0) { c_k0 = k1; continue; };
-   
+
          c_state_out_len = 3;
          BZ_GET_FAST_C(k1); c_nblock_used++;
          if (c_nblock_used == s_save_nblockPP) continue;
          if (k1 != c_k0) { c_k0 = k1; continue; };
-   
+
          BZ_GET_FAST_C(k1); c_nblock_used++;
          c_state_out_len = ((Int32)k1) + 4;
          BZ_GET_FAST_C(c_k0); c_nblock_used++;
@@ -723,37 +724,37 @@ Bool unRLE_obuf_to_output_SMALL ( DState* s )
             s->strm->total_out_lo32++;
             if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
          }
-   
+
          /* can a new run be started? */
          if (s->nblock_used == s->save_nblock+1) return False;
 
          /* Only caused by corrupt data stream? */
          if (s->nblock_used > s->save_nblock+1)
             return True;
-   
+
          s->state_out_len = 1;
          s->state_out_ch = s->k0;
-         BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; 
+         BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
          k1 ^= BZ_RAND_MASK; s->nblock_used++;
          if (s->nblock_used == s->save_nblock+1) continue;
          if (k1 != s->k0) { s->k0 = k1; continue; };
-   
+
          s->state_out_len = 2;
-         BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; 
+         BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
          k1 ^= BZ_RAND_MASK; s->nblock_used++;
          if (s->nblock_used == s->save_nblock+1) continue;
          if (k1 != s->k0) { s->k0 = k1; continue; };
-   
+
          s->state_out_len = 3;
-         BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; 
+         BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
          k1 ^= BZ_RAND_MASK; s->nblock_used++;
          if (s->nblock_used == s->save_nblock+1) continue;
          if (k1 != s->k0) { s->k0 = k1; continue; };
-   
-         BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; 
+
+         BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
          k1 ^= BZ_RAND_MASK; s->nblock_used++;
          s->state_out_len = ((Int32)k1) + 4;
-         BZ_GET_SMALL(s->k0); BZ_RAND_UPD_MASK; 
+         BZ_GET_SMALL(s->k0); BZ_RAND_UPD_MASK;
          s->k0 ^= BZ_RAND_MASK; s->nblock_used++;
       }
 
@@ -772,30 +773,30 @@ Bool unRLE_obuf_to_output_SMALL ( DState* s )
             s->strm->total_out_lo32++;
             if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
          }
-   
+
          /* can a new run be started? */
          if (s->nblock_used == s->save_nblock+1) return False;
 
          /* Only caused by corrupt data stream? */
          if (s->nblock_used > s->save_nblock+1)
             return True;
-   
+
          s->state_out_len = 1;
          s->state_out_ch = s->k0;
          BZ_GET_SMALL(k1); s->nblock_used++;
          if (s->nblock_used == s->save_nblock+1) continue;
          if (k1 != s->k0) { s->k0 = k1; continue; };
-   
+
          s->state_out_len = 2;
          BZ_GET_SMALL(k1); s->nblock_used++;
          if (s->nblock_used == s->save_nblock+1) continue;
          if (k1 != s->k0) { s->k0 = k1; continue; };
-   
+
          s->state_out_len = 3;
          BZ_GET_SMALL(k1); s->nblock_used++;
          if (s->nblock_used == s->save_nblock+1) continue;
          if (k1 != s->k0) { s->k0 = k1; continue; };
-   
+
          BZ_GET_SMALL(k1); s->nblock_used++;
          s->state_out_len = ((Int32)k1) + 4;
          BZ_GET_SMALL(s->k0); s->nblock_used++;
@@ -824,14 +825,14 @@ int BZ_API(BZ2_bzDecompress) ( bz_stream *strm )
          if (corrupt) return BZ_DATA_ERROR;
          if (s->nblock_used == s->save_nblock+1 && s->state_out_len == 0) {
             BZ_FINALISE_CRC ( s->calculatedBlockCRC );
-            if (s->verbosity >= 3) 
-               VPrintf2 ( " {0x%08x, 0x%08x}", s->storedBlockCRC, 
+            if (s->verbosity >= 3)
+               VPrintf2 ( " {0x%08x, 0x%08x}", s->storedBlockCRC,
                           s->calculatedBlockCRC );
             if (s->verbosity >= 2) VPrintf0 ( "]" );
             if (s->calculatedBlockCRC != s->storedBlockCRC)
                return BZ_DATA_ERROR;
-            s->calculatedCombinedCRC 
-               = (s->calculatedCombinedCRC << 1) | 
+            s->calculatedCombinedCRC
+               = (s->calculatedCombinedCRC << 1) |
                     (s->calculatedCombinedCRC >> 31);
             s->calculatedCombinedCRC ^= s->calculatedBlockCRC;
             s->state = BZ_X_BLKHDR_1;
@@ -843,7 +844,7 @@ int BZ_API(BZ2_bzDecompress) ( bz_stream *strm )
          Int32 r = BZ2_decompress ( s );
          if (r == BZ_STREAM_END) {
             if (s->verbosity >= 3)
-               VPrintf2 ( "\n    combined CRCs: stored = 0x%08x, computed = 0x%08x", 
+               VPrintf2 ( "\n    combined CRCs: stored = 0x%08x, computed = 0x%08x",
                           s->storedCombinedCRC, s->calculatedCombinedCRC );
             if (s->calculatedCombinedCRC != s->storedCombinedCRC)
                return BZ_DATA_ERROR;
@@ -890,7 +891,7 @@ int BZ_API(BZ2_bzDecompressEnd)  ( bz_stream *strm )
    if (bzf != NULL) bzf->lastErr = eee;   \
 }
 
-typedef 
+typedef
    struct {
       FILE*     handle;
       Char      buf[BZ_MAX_UNUSED];
@@ -914,10 +915,10 @@ static Bool myfeof ( FILE* f )
 
 
 /*---------------------------------------------------*/
-BZFILE* BZ_API(BZ2_bzWriteOpen) 
-                    ( int*  bzerror,      
-                      FILE* f, 
-                      int   blockSize100k, 
+BZFILE* BZ_API(BZ2_bzWriteOpen)
+                    ( int*  bzerror,
+                      FILE* f,
+                      int   blockSize100k,
                       int   verbosity,
                       int   workFactor )
 {
@@ -949,23 +950,23 @@ BZFILE* BZ_API(BZ2_bzWriteOpen)
    bzf->strm.opaque   = NULL;
 
    if (workFactor == 0) workFactor = 30;
-   ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k, 
+   ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k,
                               verbosity, workFactor );
    if (ret != BZ_OK)
       { BZ_SETERR(ret); free(bzf); return NULL; };
 
    bzf->strm.avail_in = 0;
    bzf->initialisedOk = True;
-   return bzf;   
+   return bzf;
 }
 
 
 
 /*---------------------------------------------------*/
 void BZ_API(BZ2_bzWrite)
-             ( int*    bzerror, 
-               BZFILE* b, 
-               void*   buf, 
+             ( int*    bzerror,
+               BZFILE* b,
+               void*   buf,
                int     len )
 {
    Int32 n, n2, ret;
@@ -994,7 +995,7 @@ void BZ_API(BZ2_bzWrite)
 
       if (bzf->strm.avail_out < BZ_MAX_UNUSED) {
          n = BZ_MAX_UNUSED - bzf->strm.avail_out;
-         n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), 
+         n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar),
                        n, bzf->handle );
          if (n != n2 || ferror(bzf->handle))
             { BZ_SETERR(BZ_IO_ERROR); return; };
@@ -1008,20 +1009,20 @@ void BZ_API(BZ2_bzWrite)
 
 /*---------------------------------------------------*/
 void BZ_API(BZ2_bzWriteClose)
-                  ( int*          bzerror, 
-                    BZFILE*       b, 
+                  ( int*          bzerror,
+                    BZFILE*       b,
                     int           abandon,
                     unsigned int* nbytes_in,
                     unsigned int* nbytes_out )
 {
-   BZ2_bzWriteClose64 ( bzerror, b, abandon, 
+   BZ2_bzWriteClose64 ( bzerror, b, abandon,
                         nbytes_in, NULL, nbytes_out, NULL );
 }
 
 
 void BZ_API(BZ2_bzWriteClose64)
-                  ( int*          bzerror, 
-                    BZFILE*       b, 
+                  ( int*          bzerror,
+                    BZFILE*       b,
                     int           abandon,
                     unsigned int* nbytes_in_lo32,
                     unsigned int* nbytes_in_hi32,
@@ -1053,7 +1054,7 @@ void BZ_API(BZ2_bzWriteClose64)
 
          if (bzf->strm.avail_out < BZ_MAX_UNUSED) {
             n = BZ_MAX_UNUSED - bzf->strm.avail_out;
-            n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), 
+            n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar),
                           n, bzf->handle );
             if (n != n2 || ferror(bzf->handle))
                { BZ_SETERR(BZ_IO_ERROR); return; };
@@ -1085,9 +1086,9 @@ void BZ_API(BZ2_bzWriteClose64)
 
 
 /*---------------------------------------------------*/
-BZFILE* BZ_API(BZ2_bzReadOpen) 
-                   ( int*  bzerror, 
-                     FILE* f, 
+BZFILE* BZ_API(BZ2_bzReadOpen)
+                   ( int*  bzerror,
+                     FILE* f,
                      int   verbosity,
                      int   small,
                      void* unused,
@@ -1098,7 +1099,7 @@ BZFILE* BZ_API(BZ2_bzReadOpen)
 
    BZ_SETERR(BZ_OK);
 
-   if (f == NULL || 
+   if (f == NULL ||
        (small != 0 && small != 1) ||
        (verbosity < 0 || verbosity > 4) ||
        (unused == NULL && nUnused != 0) ||
@@ -1109,7 +1110,7 @@ BZFILE* BZ_API(BZ2_bzReadOpen)
       { BZ_SETERR(BZ_IO_ERROR); return NULL; };
 
    bzf = malloc ( sizeof(bzFile) );
-   if (bzf == NULL) 
+   if (bzf == NULL)
       { BZ_SETERR(BZ_MEM_ERROR); return NULL; };
 
    BZ_SETERR(BZ_OK);
@@ -1121,7 +1122,7 @@ BZFILE* BZ_API(BZ2_bzReadOpen)
    bzf->strm.bzalloc  = NULL;
    bzf->strm.bzfree   = NULL;
    bzf->strm.opaque   = NULL;
-   
+
    while (nUnused > 0) {
       bzf->buf[bzf->bufN] = *((UChar*)(unused)); bzf->bufN++;
       unused = ((void*)( 1 + ((UChar*)(unused))  ));
@@ -1136,7 +1137,7 @@ BZFILE* BZ_API(BZ2_bzReadOpen)
    bzf->strm.next_in  = bzf->buf;
 
    bzf->initialisedOk = True;
-   return bzf;   
+   return bzf;
 }
 
 
@@ -1159,10 +1160,10 @@ void BZ_API(BZ2_bzReadClose) ( int *bzerror, BZFILE *b )
 
 
 /*---------------------------------------------------*/
-int BZ_API(BZ2_bzRead) 
-           ( int*    bzerror, 
-             BZFILE* b, 
-             void*   buf, 
+int BZ_API(BZ2_bzRead)
+           ( int*    bzerror,
+             BZFILE* b,
+             void*   buf,
              int     len )
 {
    Int32   n, ret;
@@ -1184,11 +1185,11 @@ int BZ_API(BZ2_bzRead)
 
    while (True) {
 
-      if (ferror(bzf->handle)) 
+      if (ferror(bzf->handle))
          { BZ_SETERR(BZ_IO_ERROR); return 0; };
 
       if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) {
-         n = fread ( bzf->buf, sizeof(UChar), 
+         n = fread ( bzf->buf, sizeof(UChar),
                      BZ_MAX_UNUSED, bzf->handle );
          if (ferror(bzf->handle))
             { BZ_SETERR(BZ_IO_ERROR); return 0; };
@@ -1202,7 +1203,7 @@ int BZ_API(BZ2_bzRead)
       if (ret != BZ_OK && ret != BZ_STREAM_END)
          { BZ_SETERR(ret); return 0; };
 
-      if (ret == BZ_OK && myfeof(bzf->handle) && 
+      if (ret == BZ_OK && myfeof(bzf->handle) &&
           bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0)
          { BZ_SETERR(BZ_UNEXPECTED_EOF); return 0; };
 
@@ -1211,7 +1212,7 @@ int BZ_API(BZ2_bzRead)
            return len - bzf->strm.avail_out; };
       if (bzf->strm.avail_out == 0)
          { BZ_SETERR(BZ_OK); return len; };
-      
+
    }
 
    return 0; /*not reached*/
@@ -1219,10 +1220,10 @@ int BZ_API(BZ2_bzRead)
 
 
 /*---------------------------------------------------*/
-void BZ_API(BZ2_bzReadGetUnused) 
-                     ( int*    bzerror, 
-                       BZFILE* b, 
-                       void**  unused, 
+void BZ_API(BZ2_bzReadGetUnused)
+                     ( int*    bzerror,
+                       BZFILE* b,
+                       void**  unused,
                        int*    nUnused )
 {
    bzFile* bzf = (bzFile*)b;
@@ -1245,30 +1246,30 @@ void BZ_API(BZ2_bzReadGetUnused)
 /*---------------------------------------------------*/
 
 /*---------------------------------------------------*/
-int BZ_API(BZ2_bzBuffToBuffCompress) 
-                         ( char*         dest, 
+int BZ_API(BZ2_bzBuffToBuffCompress)
+                         ( char*         dest,
                            unsigned int* destLen,
-                           char*         source, 
+                           char*         source,
                            unsigned int  sourceLen,
-                           int           blockSize100k, 
-                           int           verbosity, 
+                           int           blockSize100k,
+                           int           verbosity,
                            int           workFactor )
 {
    bz_stream strm;
    int ret;
 
-   if (dest == NULL || destLen == NULL || 
+   if (dest == NULL || destLen == NULL ||
        source == NULL ||
        blockSize100k < 1 || blockSize100k > 9 ||
        verbosity < 0 || verbosity > 4 ||
-       workFactor < 0 || workFactor > 250) 
+       workFactor < 0 || workFactor > 250)
       return BZ_PARAM_ERROR;
 
    if (workFactor == 0) workFactor = 30;
    strm.bzalloc = NULL;
    strm.bzfree = NULL;
    strm.opaque = NULL;
-   ret = BZ2_bzCompressInit ( &strm, blockSize100k, 
+   ret = BZ2_bzCompressInit ( &strm, blockSize100k,
                               verbosity, workFactor );
    if (ret != BZ_OK) return ret;
 
@@ -1282,7 +1283,7 @@ int BZ_API(BZ2_bzBuffToBuffCompress)
    if (ret != BZ_STREAM_END) goto errhandler;
 
    /* normal termination */
-   *destLen -= strm.avail_out;   
+   *destLen -= strm.avail_out;
    BZ2_bzCompressEnd ( &strm );
    return BZ_OK;
 
@@ -1297,10 +1298,10 @@ int BZ_API(BZ2_bzBuffToBuffCompress)
 
 
 /*---------------------------------------------------*/
-int BZ_API(BZ2_bzBuffToBuffDecompress) 
-                           ( char*         dest, 
+int BZ_API(BZ2_bzBuffToBuffDecompress)
+                           ( char*         dest,
                              unsigned int* destLen,
-                             char*         source, 
+                             char*         source,
                              unsigned int  sourceLen,
                              int           small,
                              int           verbosity )
@@ -1308,10 +1309,10 @@ int BZ_API(BZ2_bzBuffToBuffDecompress)
    bz_stream strm;
    int ret;
 
-   if (dest == NULL || destLen == NULL || 
+   if (dest == NULL || destLen == NULL ||
        source == NULL ||
        (small != 0 && small != 1) ||
-       verbosity < 0 || verbosity > 4) 
+       verbosity < 0 || verbosity > 4)
           return BZ_PARAM_ERROR;
 
    strm.bzalloc = NULL;
@@ -1341,11 +1342,11 @@ int BZ_API(BZ2_bzBuffToBuffDecompress)
    } else {
       BZ2_bzDecompressEnd ( &strm );
       return BZ_OUTBUFF_FULL;
-   };      
+   };
 
    errhandler:
    BZ2_bzDecompressEnd ( &strm );
-   return ret; 
+   return ret;
 }
 
 
@@ -1397,7 +1398,7 @@ BZFILE * bzopen_or_bzdopen
    int    verbosity     = 0;
    int    workFactor    = 30;
    int    smallMode     = 0;
-   int    nUnused       = 0; 
+   int    nUnused       = 0;
 
    if (mode == NULL) return NULL;
    while (*mode) {
@@ -1443,7 +1444,7 @@ BZFILE * bzopen_or_bzdopen
    if (writing) {
       /* Guard against total chaos and anarchy -- JRS */
       if (blockSize100k < 1) blockSize100k = 1;
-      if (blockSize100k > 9) blockSize100k = 9; 
+      if (blockSize100k > 9) blockSize100k = 9;
       bzfp = BZ2_bzWriteOpen(&bzerr,fp,blockSize100k,
                              verbosity,workFactor);
    } else {
@@ -1522,7 +1523,7 @@ void BZ_API(BZ2_bzclose) (BZFILE* b)
 {
    int bzerr;
    FILE *fp;
-   
+
    if (b==NULL) {return;}
    fp = ((bzFile *)b)->handle;
    if(((bzFile*)b)->writing){
@@ -1541,7 +1542,7 @@ void BZ_API(BZ2_bzclose) (BZFILE* b)
 
 /*---------------------------------------------------*/
 /*--
-   return last error code 
+   return last error code
 --*/
 static const char *bzerrorstrings[] = {
        "OK"

+ 83 - 83
bzip2.mod/bzip2/bzlib.h

@@ -8,10 +8,10 @@
    This file is part of bzip2/libbzip2, a program and library for
    lossless, block-sorting data compression.
 
-   bzip2/libbzip2 version 1.0.6 of 6 September 2010
+   bzip2/libbzip2 version 1.1.0 of 6 September 2010
    Copyright (C) 1996-2010 Julian Seward <[email protected]>
 
-   Please read the WARNING, DISCLAIMER and PATENTS sections in the 
+   Please read the WARNING, DISCLAIMER and PATENTS sections in the
    README file.
 
    This program is released under the terms of the license contained
@@ -45,7 +45,7 @@ extern "C" {
 #define BZ_OUTBUFF_FULL      (-8)
 #define BZ_CONFIG_ERROR      (-9)
 
-typedef 
+typedef
    struct {
       char *next_in;
       unsigned int avail_in;
@@ -62,7 +62,7 @@ typedef
       void *(*bzalloc)(void *,int,int);
       void (*bzfree)(void *,void *);
       void *opaque;
-   } 
+   }
    bz_stream;
 
 
@@ -102,34 +102,34 @@ typedef
 
 /*-- Core (low-level) library functions --*/
 
-BZ_EXTERN int BZ_API(BZ2_bzCompressInit) ( 
-      bz_stream* strm, 
-      int        blockSize100k, 
-      int        verbosity, 
-      int        workFactor 
+BZ_EXTERN int BZ_API(BZ2_bzCompressInit) (
+      bz_stream* strm,
+      int        blockSize100k,
+      int        verbosity,
+      int        workFactor
    );
 
-BZ_EXTERN int BZ_API(BZ2_bzCompress) ( 
-      bz_stream* strm, 
-      int action 
+BZ_EXTERN int BZ_API(BZ2_bzCompress) (
+      bz_stream* strm,
+      int action
    );
 
-BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) ( 
-      bz_stream* strm 
+BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) (
+      bz_stream* strm
    );
 
-BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) ( 
-      bz_stream *strm, 
-      int       verbosity, 
+BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) (
+      bz_stream *strm,
+      int       verbosity,
       int       small
    );
 
-BZ_EXTERN int BZ_API(BZ2_bzDecompress) ( 
-      bz_stream* strm 
+BZ_EXTERN int BZ_API(BZ2_bzDecompress) (
+      bz_stream* strm
    );
 
-BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) ( 
-      bz_stream *strm 
+BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) (
+      bz_stream *strm
    );
 
 
@@ -141,64 +141,64 @@ BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) (
 
 typedef void BZFILE;
 
-BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) ( 
-      int*  bzerror,   
-      FILE* f, 
-      int   verbosity, 
+BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) (
+      int*  bzerror,
+      FILE* f,
+      int   verbosity,
       int   small,
-      void* unused,    
-      int   nUnused 
+      void* unused,
+      int   nUnused
    );
 
-BZ_EXTERN void BZ_API(BZ2_bzReadClose) ( 
-      int*    bzerror, 
-      BZFILE* b 
+BZ_EXTERN void BZ_API(BZ2_bzReadClose) (
+      int*    bzerror,
+      BZFILE* b
    );
 
-BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) ( 
-      int*    bzerror, 
-      BZFILE* b, 
-      void**  unused,  
-      int*    nUnused 
+BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) (
+      int*    bzerror,
+      BZFILE* b,
+      void**  unused,
+      int*    nUnused
    );
 
-BZ_EXTERN int BZ_API(BZ2_bzRead) ( 
-      int*    bzerror, 
-      BZFILE* b, 
-      void*   buf, 
-      int     len 
+BZ_EXTERN int BZ_API(BZ2_bzRead) (
+      int*    bzerror,
+      BZFILE* b,
+      void*   buf,
+      int     len
    );
 
-BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) ( 
-      int*  bzerror,      
-      FILE* f, 
-      int   blockSize100k, 
-      int   verbosity, 
-      int   workFactor 
+BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) (
+      int*  bzerror,
+      FILE* f,
+      int   blockSize100k,
+      int   verbosity,
+      int   workFactor
    );
 
-BZ_EXTERN void BZ_API(BZ2_bzWrite) ( 
-      int*    bzerror, 
-      BZFILE* b, 
-      void*   buf, 
-      int     len 
+BZ_EXTERN void BZ_API(BZ2_bzWrite) (
+      int*    bzerror,
+      BZFILE* b,
+      void*   buf,
+      int     len
    );
 
-BZ_EXTERN void BZ_API(BZ2_bzWriteClose) ( 
-      int*          bzerror, 
-      BZFILE*       b, 
-      int           abandon, 
-      unsigned int* nbytes_in, 
-      unsigned int* nbytes_out 
+BZ_EXTERN void BZ_API(BZ2_bzWriteClose) (
+      int*          bzerror,
+      BZFILE*       b,
+      int           abandon,
+      unsigned int* nbytes_in,
+      unsigned int* nbytes_out
    );
 
-BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) ( 
-      int*          bzerror, 
-      BZFILE*       b, 
-      int           abandon, 
-      unsigned int* nbytes_in_lo32, 
-      unsigned int* nbytes_in_hi32, 
-      unsigned int* nbytes_out_lo32, 
+BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) (
+      int*          bzerror,
+      BZFILE*       b,
+      int           abandon,
+      unsigned int* nbytes_in_lo32,
+      unsigned int* nbytes_in_hi32,
+      unsigned int* nbytes_out_lo32,
       unsigned int* nbytes_out_hi32
    );
 #endif
@@ -206,23 +206,23 @@ BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) (
 
 /*-- Utility functions --*/
 
-BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) ( 
-      char*         dest, 
+BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) (
+      char*         dest,
       unsigned int* destLen,
-      char*         source, 
+      char*         source,
       unsigned int  sourceLen,
-      int           blockSize100k, 
-      int           verbosity, 
-      int           workFactor 
+      int           blockSize100k,
+      int           verbosity,
+      int           workFactor
    );
 
-BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) ( 
-      char*         dest, 
+BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) (
+      char*         dest,
       unsigned int* destLen,
-      char*         source, 
+      char*         source,
       unsigned int  sourceLen,
-      int           small, 
-      int           verbosity 
+      int           small,
+      int           verbosity
    );
 
 
@@ -249,17 +249,17 @@ BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) (
       int        fd,
       const char *mode
    );
-         
+
 BZ_EXTERN int BZ_API(BZ2_bzread) (
-      BZFILE* b, 
-      void* buf, 
-      int len 
+      BZFILE* b,
+      void* buf,
+      int len
    );
 
 BZ_EXTERN int BZ_API(BZ2_bzwrite) (
-      BZFILE* b, 
-      void*   buf, 
-      int     len 
+      BZFILE* b,
+      void*   buf,
+      int     len
    );
 
 BZ_EXTERN int BZ_API(BZ2_bzflush) (
@@ -271,7 +271,7 @@ BZ_EXTERN void BZ_API(BZ2_bzclose) (
    );
 
 BZ_EXTERN const char * BZ_API(BZ2_bzerror) (
-      BZFILE *b, 
+      BZFILE *b,
       int    *errnum
    );
 #endif

+ 13 - 13
bzip2.mod/bzip2/bzlib_private.h

@@ -8,10 +8,10 @@
    This file is part of bzip2/libbzip2, a program and library for
    lossless, block-sorting data compression.
 
-   bzip2/libbzip2 version 1.0.6 of 6 September 2010
+   bzip2/libbzip2 version 1.1.0 of 6 September 2010
    Copyright (C) 1996-2010 Julian Seward <[email protected]>
 
-   Please read the WARNING, DISCLAIMER and PATENTS sections in the 
+   Please read the WARNING, DISCLAIMER and PATENTS sections in the
    README file.
 
    This program is released under the terms of the license contained
@@ -49,7 +49,7 @@ typedef unsigned short  UInt16;
 
 #ifndef __GNUC__
 #define __inline__  /* */
-#endif 
+#endif
 
 #ifndef BZ_NO_STDIO
 
@@ -107,7 +107,7 @@ extern void bz_internal_error ( int errcode );
 #define BZ_HDR_Z 0x5a   /* 'Z' */
 #define BZ_HDR_h 0x68   /* 'h' */
 #define BZ_HDR_0 0x30   /* '0' */
-  
+
 /*-- Constants for the back end. --*/
 
 #define BZ_MAX_ALPHA_SIZE 258
@@ -267,19 +267,19 @@ typedef
 
 /*-- externs for compression. --*/
 
-extern void 
+extern void
 BZ2_blockSort ( EState* );
 
-extern void 
+extern void
 BZ2_compressBlock ( EState*, Bool );
 
-extern void 
+extern void
 BZ2_bsInitWrite ( EState* );
 
-extern void 
+extern void
 BZ2_hbAssignCodes ( Int32*, UChar*, Int32, Int32, Int32 );
 
-extern void 
+extern void
 BZ2_hbMakeCodeLengths ( UChar*, Int32*, Int32, Int32 );
 
 
@@ -423,7 +423,7 @@ typedef
       Int32    save_N;
       Int32    save_curr;
       Int32    save_zt;
-      Int32    save_zn; 
+      Int32    save_zn;
       Int32    save_zvec;
       Int32    save_zj;
       Int32    save_gSel;
@@ -479,13 +479,13 @@ typedef
 
 /*-- externs for decompression. --*/
 
-extern Int32 
+extern Int32
 BZ2_indexIntoF ( Int32, Int32* );
 
-extern Int32 
+extern Int32
 BZ2_decompress ( DState* );
 
-extern void 
+extern void
 BZ2_hbCreateDecodeTables ( Int32*, Int32*, Int32*, UChar*,
                            Int32,  Int32, Int32 );
 

+ 26 - 0
bzip2.mod/bzip2/cmake/SymLink.cmake

@@ -0,0 +1,26 @@
+# Install a symlink of script to the "bin" directory.
+# Not intended for use on Windows.
+function(install_script_symlink original symlink)
+    add_custom_command(OUTPUT ${symlink}
+        COMMAND ${CMAKE_COMMAND} -E create_symlink ${original} ${symlink}
+        DEPENDS ${original}
+        COMMENT "Generating symbolic link ${symlink} of ${original}")
+    add_custom_target(${symlink}_tgt ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${symlink})
+    install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${symlink} DESTINATION ${CMAKE_INSTALL_BINDIR})
+endfunction()
+
+# Install a symlink of binary target to the "bin" directory.
+# On Windows, it will be a copy instead of a symlink.
+function(install_target_symlink original symlink)
+    if(WIN32)
+        set(op copy)
+        set(symlink "${symlink}.exe")
+    else()
+        set(op create_symlink)
+    endif()
+    add_custom_command(TARGET ${original} POST_BUILD
+        COMMAND ${CMAKE_COMMAND} -E ${op} $<TARGET_FILE_NAME:${original}> ${symlink}
+        WORKING_DIRECTORY $<TARGET_FILE_DIR:${original}>
+        COMMENT "Generating symbolic link (or copy) ${symlink} of ${original}")
+    install(PROGRAMS $<TARGET_FILE_DIR:${original}>/${symlink} DESTINATION ${CMAKE_INSTALL_BINDIR})
+endfunction()

+ 48 - 49
bzip2.mod/bzip2/compress.c

@@ -8,10 +8,10 @@
    This file is part of bzip2/libbzip2, a program and library for
    lossless, block-sorting data compression.
 
-   bzip2/libbzip2 version 1.0.6 of 6 September 2010
+   bzip2/libbzip2 version 1.1.0 of 6 September 2010
    Copyright (C) 1996-2010 Julian Seward <[email protected]>
 
-   Please read the WARNING, DISCLAIMER and PATENTS sections in the 
+   Please read the WARNING, DISCLAIMER and PATENTS sections in the
    README file.
 
    This program is released under the terms of the license contained
@@ -22,7 +22,7 @@
 /* CHANGES
     0.9.0    -- original version.
     0.9.0a/b -- no changes in this file.
-    0.9.0c   -- changed setting of nGroups in sendMTFValues() 
+    0.9.0c   -- changed setting of nGroups in sendMTFValues()
                 so as to do a bit better on small files
 */
 
@@ -125,11 +125,11 @@ void generateMTFValues ( EState* s )
    Int32   wr;
    Int32   EOB;
 
-   /* 
+   /*
       After sorting (eg, here),
          s->arr1 [ 0 .. s->nblock-1 ] holds sorted order,
          and
-         ((UChar*)s->arr2) [ 0 .. s->nblock-1 ] 
+         ((UChar*)s->arr2) [ 0 .. s->nblock-1 ]
          holds the original block data.
 
       The first thing to do is generate the MTF values,
@@ -144,7 +144,7 @@ void generateMTFValues ( EState* s )
          (UChar*) (&((UChar*)s->arr2)[s->nblock])
 
       These storage aliases are set up in bzCompressInit(),
-      except for the last one, which is arranged in 
+      except for the last one, which is arranged in
       compressBlock().
    */
    UInt32* ptr   = s->ptr;
@@ -167,7 +167,7 @@ void generateMTFValues ( EState* s )
       ll_i = s->unseqToSeq[block[j]];
       AssertD ( ll_i < s->nInUse, "generateMTFValues(2a)" );
 
-      if (yy[0] == ll_i) { 
+      if (yy[0] == ll_i) {
          zPend++;
       } else {
 
@@ -175,11 +175,11 @@ void generateMTFValues ( EState* s )
             zPend--;
             while (True) {
                if (zPend & 1) {
-                  mtfv[wr] = BZ_RUNB; wr++; 
-                  s->mtfFreq[BZ_RUNB]++; 
+                  mtfv[wr] = BZ_RUNB; wr++;
+                  s->mtfFreq[BZ_RUNB]++;
                } else {
-                  mtfv[wr] = BZ_RUNA; wr++; 
-                  s->mtfFreq[BZ_RUNA]++; 
+                  mtfv[wr] = BZ_RUNA; wr++;
+                  s->mtfFreq[BZ_RUNA]++;
                }
                if (zPend < 2) break;
                zPend = (zPend - 2) / 2;
@@ -213,11 +213,11 @@ void generateMTFValues ( EState* s )
       zPend--;
       while (True) {
          if (zPend & 1) {
-            mtfv[wr] = BZ_RUNB; wr++; 
-            s->mtfFreq[BZ_RUNB]++; 
+            mtfv[wr] = BZ_RUNB; wr++;
+            s->mtfFreq[BZ_RUNB]++;
          } else {
-            mtfv[wr] = BZ_RUNA; wr++; 
-            s->mtfFreq[BZ_RUNA]++; 
+            mtfv[wr] = BZ_RUNA; wr++;
+            s->mtfFreq[BZ_RUNA]++;
          }
          if (zPend < 2) break;
          zPend = (zPend - 2) / 2;
@@ -260,7 +260,7 @@ void sendMTFValues ( EState* s )
 
    if (s->verbosity >= 3)
       VPrintf3( "      %d in block, %d after MTF & 1-2 coding, "
-                "%d+2 syms in use\n", 
+                "%d+2 syms in use\n",
                 s->nblock, s->nMTF, s->nInUse );
 
    alphaSize = s->nInUse+2;
@@ -277,7 +277,7 @@ void sendMTFValues ( EState* s )
                        nGroups = 6;
 
    /*--- Generate an initial set of coding tables ---*/
-   { 
+   {
       Int32 nPart, remF, tFreq, aFreq;
 
       nPart = nGroups;
@@ -292,8 +292,8 @@ void sendMTFValues ( EState* s )
             aFreq += s->mtfFreq[ge];
          }
 
-         if (ge > gs 
-             && nPart != nGroups && nPart != 1 
+         if (ge > gs
+             && nPart != nGroups && nPart != 1
              && ((nGroups-nPart) % 2 == 1)) {
             aFreq -= s->mtfFreq[ge];
             ge--;
@@ -302,21 +302,21 @@ void sendMTFValues ( EState* s )
          if (s->verbosity >= 3)
             VPrintf5( "      initial group %d, [%d .. %d], "
                       "has %d syms (%4.1f%%)\n",
-                      nPart, gs, ge, aFreq, 
+                      nPart, gs, ge, aFreq,
                       (100.0 * (float)aFreq) / (float)(s->nMTF) );
- 
+
          for (v = 0; v < alphaSize; v++)
-            if (v >= gs && v <= ge) 
+            if (v >= gs && v <= ge)
                s->len[nPart-1][v] = BZ_LESSER_ICOST; else
                s->len[nPart-1][v] = BZ_GREATER_ICOST;
- 
+
          nPart--;
          gs = ge+1;
          remF -= aFreq;
       }
    }
 
-   /*--- 
+   /*---
       Iterate up to BZ_N_ITERS times to improve the tables.
    ---*/
    for (iter = 0; iter < BZ_N_ITERS; iter++) {
@@ -329,14 +329,14 @@ void sendMTFValues ( EState* s )
 
       /*---
         Set up an auxiliary length table which is used to fast-track
-	the common case (nGroups == 6). 
+        the common case (nGroups == 6).
       ---*/
       if (nGroups == 6) {
          for (v = 0; v < alphaSize; v++) {
             s->len_pack[v][0] = (s->len[1][v] << 16) | s->len[0][v];
             s->len_pack[v][1] = (s->len[3][v] << 16) | s->len[2][v];
             s->len_pack[v][2] = (s->len[5][v] << 16) | s->len[4][v];
-	 }
+         }
       }
 
       nSelectors = 0;
@@ -346,10 +346,10 @@ void sendMTFValues ( EState* s )
 
          /*--- Set group start & end marks. --*/
          if (gs >= s->nMTF) break;
-         ge = gs + BZ_G_SIZE - 1; 
+         ge = gs + BZ_G_SIZE - 1;
          if (ge >= s->nMTF) ge = s->nMTF-1;
 
-         /*-- 
+         /*--
             Calculate the cost of this group as coded
             by each of the coding tables.
          --*/
@@ -385,14 +385,14 @@ void sendMTFValues ( EState* s )
             cost[4] = cost45 & 0xffff; cost[5] = cost45 >> 16;
 
          } else {
-	    /*--- slow version which correctly handles all situations ---*/
-            for (i = gs; i <= ge; i++) { 
+            /*--- slow version which correctly handles all situations ---*/
+            for (i = gs; i <= ge; i++) {
                UInt16 icv = mtfv[i];
                for (t = 0; t < nGroups; t++) cost[t] += s->len[t][icv];
             }
          }
- 
-         /*-- 
+
+         /*--
             Find the coding table which is best for this group,
             and record its identity in the selector table.
          --*/
@@ -404,7 +404,7 @@ void sendMTFValues ( EState* s )
          s->selector[nSelectors] = bt;
          nSelectors++;
 
-         /*-- 
+         /*--
             Increment the symbol frequencies for the selected table.
           --*/
          if (nGroups == 6 && 50 == ge-gs+1) {
@@ -426,7 +426,7 @@ void sendMTFValues ( EState* s )
 #           undef BZ_ITUR
 
          } else {
-	    /*--- slow version which correctly handles all situations ---*/
+            /*--- slow version which correctly handles all situations ---*/
             for (i = gs; i <= ge; i++)
                s->rfreq[bt][ mtfv[i] ]++;
          }
@@ -434,7 +434,7 @@ void sendMTFValues ( EState* s )
          gs = ge+1;
       }
       if (s->verbosity >= 3) {
-         VPrintf2 ( "      pass %d: size is %d, grp uses are ", 
+         VPrintf2 ( "      pass %d: size is %d, grp uses are ",
                    iter+1, totc/8 );
          for (t = 0; t < nGroups; t++)
             VPrintf1 ( "%d ", fave[t] );
@@ -444,10 +444,10 @@ void sendMTFValues ( EState* s )
       /*--
         Recompute the tables based on the accumulated frequencies.
       --*/
-      /* maxLen was changed from 20 to 17 in bzip2-1.0.3.  See 
+      /* maxLen was changed from 20 to 17 in bzip2-1.0.3.  See
          comment in huffman.c for details. */
       for (t = 0; t < nGroups; t++)
-         BZ2_hbMakeCodeLengths ( &(s->len[t][0]), &(s->rfreq[t][0]), 
+         BZ2_hbMakeCodeLengths ( &(s->len[t][0]), &(s->rfreq[t][0]),
                                  alphaSize, 17 /*20*/ );
    }
 
@@ -487,19 +487,19 @@ void sendMTFValues ( EState* s )
       }
       AssertH ( !(maxLen > 17 /*20*/ ), 3004 );
       AssertH ( !(minLen < 1),  3005 );
-      BZ2_hbAssignCodes ( &(s->code[t][0]), &(s->len[t][0]), 
+      BZ2_hbAssignCodes ( &(s->code[t][0]), &(s->len[t][0]),
                           minLen, maxLen, alphaSize );
    }
 
    /*--- Transmit the mapping table. ---*/
-   { 
+   {
       Bool inUse16[16];
       for (i = 0; i < 16; i++) {
           inUse16[i] = False;
           for (j = 0; j < 16; j++)
              if (s->inUse[i * 16 + j]) inUse16[i] = True;
       }
-     
+
       nBytes = s->numZ;
       for (i = 0; i < 16; i++)
          if (inUse16[i]) bsW(s,1,1); else bsW(s,1,0);
@@ -510,7 +510,7 @@ void sendMTFValues ( EState* s )
                if (s->inUse[i * 16 + j]) bsW(s,1,1); else bsW(s,1,0);
             }
 
-      if (s->verbosity >= 3) 
+      if (s->verbosity >= 3)
          VPrintf1( "      bytes: mapping %d, ", s->numZ-nBytes );
    }
 
@@ -518,7 +518,7 @@ void sendMTFValues ( EState* s )
    nBytes = s->numZ;
    bsW ( s, 3, nGroups );
    bsW ( s, 15, nSelectors );
-   for (i = 0; i < nSelectors; i++) { 
+   for (i = 0; i < nSelectors; i++) {
       for (j = 0; j < s->selectorMtf[i]; j++) bsW(s,1,1);
       bsW(s,1,0);
    }
@@ -547,14 +547,14 @@ void sendMTFValues ( EState* s )
    gs = 0;
    while (True) {
       if (gs >= s->nMTF) break;
-      ge = gs + BZ_G_SIZE - 1; 
+      ge = gs + BZ_G_SIZE - 1;
       if (ge >= s->nMTF) ge = s->nMTF-1;
       AssertH ( s->selector[selCtr] < nGroups, 3006 );
 
       if (nGroups == 6 && 50 == ge-gs+1) {
             /*--- fast track the common case ---*/
             UInt16 mtfv_i;
-            UChar* s_len_sel_selCtr 
+            UChar* s_len_sel_selCtr
                = &(s->len[s->selector[selCtr]][0]);
             Int32* s_code_sel_selCtr
                = &(s->code[s->selector[selCtr]][0]);
@@ -579,15 +579,14 @@ void sendMTFValues ( EState* s )
 #           undef BZ_ITAH
 
       } else {
-	 /*--- slow version which correctly handles all situations ---*/
+         /*--- slow version which correctly handles all situations ---*/
          for (i = gs; i <= ge; i++) {
-            bsW ( s, 
+            bsW ( s,
                   s->len  [s->selector[selCtr]] [mtfv[i]],
                   s->code [s->selector[selCtr]] [mtfv[i]] );
          }
       }
 
-
       gs = ge+1;
       selCtr++;
    }
@@ -636,8 +635,8 @@ void BZ2_compressBlock ( EState* s, Bool is_last_block )
       /*-- Now the block's CRC, so it is in a known place. --*/
       bsPutUInt32 ( s, s->blockCRC );
 
-      /*-- 
-         Now a single bit indicating (non-)randomisation. 
+      /*--
+         Now a single bit indicating (non-)randomisation.
          As of version 0.9.5, we use a better sorting algorithm
          which makes randomisation unnecessary.  So always set
          the randomised bit to 'no'.  Of course, the decoder

+ 2 - 2
bzip2.mod/bzip2/crctable.c

@@ -8,10 +8,10 @@
    This file is part of bzip2/libbzip2, a program and library for
    lossless, block-sorting data compression.
 
-   bzip2/libbzip2 version 1.0.6 of 6 September 2010
+   bzip2/libbzip2 version 1.1.0 of 6 September 2010
    Copyright (C) 1996-2010 Julian Seward <[email protected]>
 
-   Please read the WARNING, DISCLAIMER and PATENTS sections in the 
+   Please read the WARNING, DISCLAIMER and PATENTS sections in the
    README file.
 
    This program is released under the terms of the license contained

+ 25 - 25
bzip2.mod/bzip2/decompress.c

@@ -8,10 +8,10 @@
    This file is part of bzip2/libbzip2, a program and library for
    lossless, block-sorting data compression.
 
-   bzip2/libbzip2 version 1.0.6 of 6 September 2010
+   bzip2/libbzip2 version 1.1.0 of 6 September 2010
    Copyright (C) 1996-2010 Julian Seward <[email protected]>
 
-   Please read the WARNING, DISCLAIMER and PATENTS sections in the 
+   Please read the WARNING, DISCLAIMER and PATENTS sections in the
    README file.
 
    This program is released under the terms of the license contained
@@ -127,7 +127,7 @@ Int32 BZ2_decompress ( DState* s )
    Int32  N;
    Int32  curr;
    Int32  zt;
-   Int32  zn; 
+   Int32  zn;
    Int32  zvec;
    Int32  zj;
    Int32  gSel;
@@ -181,7 +181,7 @@ Int32 BZ2_decompress ( DState* s )
    N           = s->save_N;
    curr        = s->save_curr;
    zt          = s->save_zt;
-   zn          = s->save_zn; 
+   zn          = s->save_zn;
    zvec        = s->save_zvec;
    zj          = s->save_zj;
    gSel        = s->save_gSel;
@@ -204,14 +204,14 @@ Int32 BZ2_decompress ( DState* s )
       if (uc != BZ_HDR_h) RETURN(BZ_DATA_ERROR_MAGIC);
 
       GET_BITS(BZ_X_MAGIC_4, s->blockSize100k, 8)
-      if (s->blockSize100k < (BZ_HDR_0 + 1) || 
+      if (s->blockSize100k < (BZ_HDR_0 + 1) ||
           s->blockSize100k > (BZ_HDR_0 + 9)) RETURN(BZ_DATA_ERROR_MAGIC);
       s->blockSize100k -= BZ_HDR_0;
 
       if (s->smallDecompress) {
          s->ll16 = BZALLOC( s->blockSize100k * 100000 * sizeof(UInt16) );
-         s->ll4  = BZALLOC( 
-                      ((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar) 
+         s->ll4  = BZALLOC(
+                      ((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar)
                    );
          if (s->ll16 == NULL || s->ll4 == NULL) RETURN(BZ_MEM_ERROR);
       } else {
@@ -237,7 +237,7 @@ Int32 BZ2_decompress ( DState* s )
       s->currBlockNo++;
       if (s->verbosity >= 2)
          VPrintf1 ( "\n    [%d: huff+mtf ", s->currBlockNo );
- 
+
       s->storedBlockCRC = 0;
       GET_UCHAR(BZ_X_BCRC_1, uc);
       s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
@@ -260,14 +260,14 @@ Int32 BZ2_decompress ( DState* s )
 
       if (s->origPtr < 0)
          RETURN(BZ_DATA_ERROR);
-      if (s->origPtr > 10 + 100000*s->blockSize100k) 
+      if (s->origPtr > 10 + 100000*s->blockSize100k)
          RETURN(BZ_DATA_ERROR);
 
       /*--- Receive the mapping table ---*/
       for (i = 0; i < 16; i++) {
          GET_BIT(BZ_X_MAPPING_1, uc);
-         if (uc == 1) 
-            s->inUse16[i] = True; else 
+         if (uc == 1)
+            s->inUse16[i] = True; else
             s->inUse16[i] = False;
       }
 
@@ -309,7 +309,7 @@ Int32 BZ2_decompress ( DState* s )
       {
          UChar pos[BZ_N_GROUPS], tmp, v;
          for (v = 0; v < nGroups; v++) pos[v] = v;
-   
+
          for (i = 0; i < nSelectors; i++) {
             v = s->selectorMtf[i];
             tmp = pos[v];
@@ -342,10 +342,10 @@ Int32 BZ2_decompress ( DState* s )
             if (s->len[t][i] > maxLen) maxLen = s->len[t][i];
             if (s->len[t][i] < minLen) minLen = s->len[t][i];
          }
-         BZ2_hbCreateDecodeTables ( 
-            &(s->limit[t][0]), 
-            &(s->base[t][0]), 
-            &(s->perm[t][0]), 
+         BZ2_hbCreateDecodeTables (
+            &(s->limit[t][0]),
+            &(s->base[t][0]),
+            &(s->perm[t][0]),
             &(s->len[t][0]),
             minLen, maxLen, alphaSize
          );
@@ -444,23 +444,23 @@ Int32 BZ2_decompress ( DState* s )
                      s->mtfa[(z)-3] = s->mtfa[(z)-4];
                      nn -= 4;
                   }
-                  while (nn > 0) { 
-                     s->mtfa[(pp+nn)] = s->mtfa[(pp+nn)-1]; nn--; 
+                  while (nn > 0) {
+                     s->mtfa[(pp+nn)] = s->mtfa[(pp+nn)-1]; nn--;
                   };
                   s->mtfa[pp] = uc;
-               } else { 
+               } else {
                   /* general case */
                   lno = nn / MTFL_SIZE;
                   off = nn % MTFL_SIZE;
                   pp = s->mtfbase[lno] + off;
                   uc = s->mtfa[pp];
-                  while (pp > s->mtfbase[lno]) { 
-                     s->mtfa[pp] = s->mtfa[pp-1]; pp--; 
+                  while (pp > s->mtfbase[lno]) {
+                     s->mtfa[pp] = s->mtfa[pp-1]; pp--;
                   };
                   s->mtfbase[lno]++;
                   while (lno > 0) {
                      s->mtfbase[lno]--;
-                     s->mtfa[s->mtfbase[lno]] 
+                     s->mtfa[s->mtfbase[lno]]
                         = s->mtfa[s->mtfbase[lno-1] + MTFL_SIZE - 1];
                      lno--;
                   }
@@ -555,7 +555,7 @@ Int32 BZ2_decompress ( DState* s )
          if (s->blockRandomised) {
             BZ_RAND_INIT_MASK;
             BZ_GET_SMALL(s->k0); s->nblock_used++;
-            BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; 
+            BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK;
          } else {
             BZ_GET_SMALL(s->k0); s->nblock_used++;
          }
@@ -574,7 +574,7 @@ Int32 BZ2_decompress ( DState* s )
          if (s->blockRandomised) {
             BZ_RAND_INIT_MASK;
             BZ_GET_FAST(s->k0); s->nblock_used++;
-            BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; 
+            BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK;
          } else {
             BZ_GET_FAST(s->k0); s->nblock_used++;
          }
@@ -643,7 +643,7 @@ Int32 BZ2_decompress ( DState* s )
    s->save_gBase       = gBase;
    s->save_gPerm       = gPerm;
 
-   return retVal;   
+   return retVal;
 }
 
 

+ 12 - 5
bzip2.mod/bzip2/docs/RELEASING.md

@@ -1,7 +1,14 @@
-Release checklist:
+# Release Checklist
 
-* [ ] Increment package version at the top of meson.build and CMakeLists.txt
-      
-* [ ] Increment library revision in meson.build and CMakeLists.txt
+* [ ] Increment package version at the top of [meson.build](../meson.build) and
+  [CMakeLists.txt](../CMakeLists.txt)
 
-* [ ] If interfaces were added, changed, or deleted, adjust per meson.build and CMakeLists.txt
+* [ ] Increment library revision in [meson.build](../meson.build) and
+  [CMakeLists.txt](../CMakeLists.txt)
+
+* [ ] If interfaces were added, changed, or deleted, adjust per
+  [meson.build](../meson.build) and [CMakeLists.txt](../CMakeLists.txt).
+  See the GNU libtool versioning rules for library revision numbering advice:
+  http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
+
+* [ ] On release day, create a new `release/*` branch and create a release tag.

+ 7 - 4
bzip2.mod/bzip2/docs/bz-html.xsl

@@ -7,11 +7,14 @@
 <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
 <xsl:import href="bz-common.xsl"/>
 
-<!-- use 8859-1 encoding -->
-<xsl:output method="html" encoding="ISO-8859-1" indent="yes"/>
+<!-- use UTF-8 encoding -->
+<xsl:output method="html" encoding="UTF-8" indent="yes"/>
 
-<!-- we include the css directly when generating one large file -->
-<xsl:template name="user.head.content">  
+<!-- we include the css as link and directly when generating one large file -->
+<xsl:template name="user.head.content">
+  <xsl:text disable-output-escaping="yes">
+<![CDATA[<]]>link rel="stylesheet" type="text/css" href="bzip.css" />
+  </xsl:text>
   <style type="text/css" media="screen">
     <xsl:text>&bz-css;</xsl:text>
   </style>

+ 1 - 1
bzip2.mod/bzip2/docs/entities.xml

@@ -1,5 +1,5 @@
 <!-- misc. strings -->
-<!ENTITY bz-url "https://sourceware.org/bzip2/">
+<!ENTITY bz-url "https://gitlab.com/bzip2/bzip2">
 <!ENTITY bz-email "[email protected]">
 <!ENTITY bz-lifespan "1996-2010">
 

+ 4 - 4
bzip2.mod/bzip2/docs/format.pl

@@ -4,10 +4,10 @@
 # This file is part of bzip2/libbzip2, a program and library for
 # lossless, block-sorting data compression.
 #
-# bzip2/libbzip2 version 1.0.6 of 6 September 2010
+# bzip2/libbzip2 version 1.1.0 of 6 September 2010
 # Copyright (C) 1996-2010 Julian Seward <[email protected]>
 #
-# Please read the WARNING, DISCLAIMER and PATENTS sections in the 
+# Please read the WARNING, DISCLAIMER and PATENTS sections in the
 # README file.
 #
 # This program is released under the terms of the license contained
@@ -30,14 +30,14 @@ if (! -r $infile) {
     die "Can't read input $infile\n";
 }
 # check we can open infile
-open( INFILE,"<$infile" ) or 
+open( INFILE,"<$infile" ) or
     die "Can't input $infile $!";
 
 #my $outfile = 'fmt-manual.xml';
 my $outfile = shift;
 #print "Infile: $infile, Outfile: $outfile\n";
 # check we can write to outfile
-open( OUTFILE,">$outfile" ) or 
+open( OUTFILE,">$outfile" ) or
     die "Can't output $outfile $! for writing";
 
 my ($prev, $curr, $str);

+ 52 - 36
bzip2.mod/bzip2/docs/manual.xml

@@ -27,7 +27,7 @@
    </author>
   </authorgroup>
 
-  <legalnotice>
+  <legalnotice id="legal">
 
   <para>This program, <computeroutput>bzip2</computeroutput>, the
   associated library <computeroutput>libbzip2</computeroutput>, and
@@ -160,12 +160,21 @@ else.</para>
  <listitem><para><computeroutput>bzip2</computeroutput> [
   -cdfkqstvzVL123456789 ] [ filenames ...  ]</para></listitem>
 
+ <listitem><para><computeroutput>bzip2</computeroutput> [
+  -h | --help ]</para></listitem>
+
  <listitem><para><computeroutput>bunzip2</computeroutput> [
   -fkvsVL ] [ filenames ...  ]</para></listitem>
 
+ <listitem><para><computeroutput>bunzip2</computeroutput> [
+  -h | --help ]</para></listitem>
+
  <listitem><para><computeroutput>bzcat</computeroutput> [ -s ] [
   filenames ...  ]</para></listitem>
 
+ <listitem><para><computeroutput>bzcat</computeroutput> [
+  -h | --help ]</para></listitem>
+
  <listitem><para><computeroutput>bzip2recover</computeroutput>
   filename</para></listitem>
 
@@ -344,7 +353,7 @@ consistency error (eg, bug) which caused
  <term><computeroutput>-z --compress</computeroutput></term>
  <listitem><para>The complement to
   <computeroutput>-d</computeroutput>: forces compression,
-  regardless of the invokation name.</para></listitem>
+  regardless of the invocation name.</para></listitem>
  </varlistentry>
 
  <varlistentry>
@@ -397,6 +406,10 @@ consistency error (eg, bug) which caused
   will not be suppressed.</para></listitem>
  </varlistentry>
 
+ <varlistentry><term><computeroutput>-h --help</computeroutput></term>
+ <listitem><para>Print a help message and exit.</para></listitem>
+ </varlistentry>
+
  <varlistentry>
  <term><computeroutput>-v --verbose</computeroutput></term>
  <listitem><para>Verbose mode -- show the compression ratio for
@@ -668,7 +681,7 @@ their help, support and advice.  See the manual in the source
 distribution for pointers to sources of documentation.  Christian
 von Roques encouraged me to look for faster sorting algorithms,
 so as to speed up compression.  Bela Lubkin encouraged me to
-improve the worst-case compression performance.  
+improve the worst-case compression performance.
 Donna Robinson XMLised the documentation.
 Many people sent
 patches, helped with portability problems, lent machines, gave
@@ -776,7 +789,7 @@ concatenated end-to-end.</para>
 <para>For reading files,
 <computeroutput>BZ2_bzReadOpen</computeroutput>,
 <computeroutput>BZ2_bzRead</computeroutput>,
-<computeroutput>BZ2_bzReadClose</computeroutput> and 
+<computeroutput>BZ2_bzReadClose</computeroutput> and
 <computeroutput>BZ2_bzReadGetUnused</computeroutput> are
 supplied.  For writing files,
 <computeroutput>BZ2_bzWriteOpen</computeroutput>,
@@ -888,7 +901,7 @@ denote an error situation.</para>
  <varlistentry>
   <term><computeroutput>BZ_RUN_OK, BZ_FLUSH_OK,
     BZ_FINISH_OK</computeroutput></term>
-  <listitem><para>In 
+  <listitem><para>In
    <computeroutput>BZ2_bzCompress</computeroutput>, the requested
    flush/finish/nothing-special action was completed
    successfully.</para></listitem>
@@ -1054,8 +1067,8 @@ typedef struct {
   void *opaque;
 } bz_stream;
 
-int BZ2_bzCompressInit ( bz_stream *strm, 
-                         int blockSize100k, 
+int BZ2_bzCompressInit ( bz_stream *strm,
+                         int blockSize100k,
                          int verbosity,
                          int workFactor );
 </programlisting>
@@ -1161,13 +1174,13 @@ obsolete.</para>
 BZ_CONFIG_ERROR
   if the library has been mis-compiled
 BZ_PARAM_ERROR
-  if strm is NULL 
+  if strm is NULL
   or blockSize < 1 or blockSize > 9
   or verbosity < 0 or verbosity > 4
   or workFactor < 0 or workFactor > 250
-BZ_MEM_ERROR 
+BZ_MEM_ERROR
   if not enough memory is available
-BZ_OK 
+BZ_OK
   otherwise
 </programlisting>
 
@@ -1332,7 +1345,7 @@ RUNNING/BZ_FINISH
   Return value = BZ_FINISH_OK
 
 FLUSHING/BZ_FLUSH
-  Compress from next_in to next_out as much as possible, 
+  Compress from next_in to next_out as much as possible,
   but do not accept any more input.
   If all the existing input has been used up and all compressed
   output has been removed
@@ -1340,13 +1353,13 @@ FLUSHING/BZ_FLUSH
   else
     Next state = FLUSHING; Return value = BZ_FLUSH_OK
 
-FLUSHING/other     
+FLUSHING/other
   Illegal.
   Return value = BZ_SEQUENCE_ERROR
 
 FINISHING/BZ_FINISH
   Compress from next_in to next_out as much as possible,
-  but to not accept any more input.  
+  but to not accept any more input.
   If all the existing input has been used up and all compressed
   output has been removed
     Next state = IDLE; Return value = BZ_STREAM_END
@@ -1570,6 +1583,8 @@ BZ_MEM_ERROR
 BZ_STREAM_END
   if the logical end of the data stream was detected and all
   output in has been consumed, eg s-->avail_out > 0
+BZ_SEQUENCE_ERROR
+  if called after an earlier call already returned BZ_STREAM_END
 BZ_OK
   otherwise
 </programlisting>
@@ -1687,7 +1702,7 @@ general points.</para>
 <programlisting>
 typedef void BZFILE;
 
-BZFILE *BZ2_bzReadOpen( int *bzerror, FILE *f, 
+BZFILE *BZ2_bzReadOpen( int *bzerror, FILE *f,
                         int verbosity, int small,
                         void *unused, int nUnused );
 </programlisting>
@@ -1819,13 +1834,13 @@ BZ_SEQUENCE_ERROR
 BZ_IO_ERROR
   if there is an error reading from the compressed file
 BZ_UNEXPECTED_EOF
-  if the compressed file ended before 
+  if the compressed file ended before
   the logical end-of-stream was detected
 BZ_DATA_ERROR
   if a data integrity error was detected in the compressed stream
 BZ_DATA_ERROR_MAGIC
-  if the stream does not begin with the requisite header bytes 
-  (ie, is not a bzip2 data file).  This is really 
+  if the stream does not begin with the requisite header bytes
+  (ie, is not a bzip2 data file).  This is really
   a special case of BZ_DATA_ERROR.
 BZ_MEM_ERROR
   if insufficient memory was available
@@ -1862,7 +1877,7 @@ BZ2_bzReadClose
 <title>BZ2_bzReadGetUnused</title>
 
 <programlisting>
-void BZ2_bzReadGetUnused( int* bzerror, BZFILE *b, 
+void BZ2_bzReadGetUnused( int* bzerror, BZFILE *b,
                           void** unused, int* nUnused );
 </programlisting>
 
@@ -1940,7 +1955,7 @@ none
 <title>BZ2_bzWriteOpen</title>
 
 <programlisting>
-BZFILE *BZ2_bzWriteOpen( int *bzerror, FILE *f, 
+BZFILE *BZ2_bzWriteOpen( int *bzerror, FILE *f,
                          int blockSize100k, int verbosity,
                          int workFactor );
 </programlisting>
@@ -2178,7 +2193,7 @@ if (bzerror != BZ_OK) {
 while ( /* condition */ ) {
  /* get data to write into buf, and set nBuf appropriately */
  nWritten = BZ2_bzWrite ( &bzerror, b, buf, nBuf );
- if (bzerror == BZ_IO_ERROR) { 
+ if (bzerror == BZ_IO_ERROR) {
    BZ2_bzWriteClose ( &bzerror, b );
    /* handle error */
  }
@@ -2291,7 +2306,7 @@ BZ_PARAM_ERROR
   or verbosity < 0 or verbosity > 4
   or workFactor < 0 or workFactor > 250
 BZ_MEM_ERROR
-  if insufficient memory is available 
+  if insufficient memory is available
 BZ_OUTBUFF_FULL
   if the size of the compressed data exceeds *destLen
 BZ_OK
@@ -2358,7 +2373,7 @@ BZ_PARAM_ERROR
   or small != 0 && small != 1
   or verbosity < 0 or verbosity > 4
 BZ_MEM_ERROR
-  if insufficient memory is available 
+  if insufficient memory is available
 BZ_OUTBUFF_FULL
   if the size of the compressed data exceeds *destLen
 BZ_DATA_ERROR
@@ -2442,7 +2457,7 @@ value.</para>
 </sect1>
 
 
-<sect1 id="stdio-free" 
+<sect1 id="stdio-free"
        xreflabel="Using the library in a stdio-free environment">
 <title>Using the library in a stdio-free environment</title>
 
@@ -2487,12 +2502,13 @@ message:</para>
 <blockquote>
 <para>bzip2/libbzip2: internal error number N.</para>
 <para>This is a bug in bzip2/libbzip2, &bz-version; of &bz-date;.
-Please report it to me at: &bz-email;.  If this happened
-when you were using some program which uses libbzip2 as a
-component, you should also report this bug to the author(s)
-of that program.  Please make an effort to report this bug;
+Please report it at: https://gitlab.com/bzip2/bzip2/-/issues.
+If this happened when you were using some program which uses
+libbzip2 as a component, you should also report this bug to
+the author(s) of that program.
+Please make an effort to report this bug;
 timely and accurate bug reports eventually lead to higher
-quality software.  Thanks.  Julian Seward, &bz-date;.
+quality software.  Thanks.
 </para></blockquote>
 
 <para>where <computeroutput>N</computeroutput> is some error code
@@ -2641,7 +2657,7 @@ are:</para>
 
    <para>Probably the best long-term solution, and the one I have
    incorporated into 0.9.5 and above, is to use the existing
-   sorting algorithm initially, and fall back to a O(N (log N)^2)
+   sorting algorithm initially, and fall back to an O(N (log N)^2)
    algorithm if the standard algorithm gets into
    difficulties.</para></listitem>
 
@@ -2838,9 +2854,9 @@ them because "oh, they won't be relevant".  At the bare
 minimum:</para>
 
 <programlisting>
-Machine type.  Operating system version.  
-Exact version of bzip2 (do bzip2 -V).  
-Exact version of the compiler used.  
+Machine type.  Operating system version.
+Exact version of bzip2 (do bzip2 -V).
+Exact version of the compiler used.
 Flags passed to the compiler.
 </programlisting>
 
@@ -2870,14 +2886,14 @@ an intrinsic property of the Burrows-Wheeler transform
 uses less memory but gets pretty good compression, and has
 minimal latency, consider Jean-loup Gailly's and Mark Adler's
 work, <computeroutput>zlib-1.2.1</computeroutput> and
-<computeroutput>gzip-1.2.4</computeroutput>.  Look for them at 
-<ulink url="http://www.zlib.org">http://www.zlib.org</ulink> and 
+<computeroutput>gzip-1.2.4</computeroutput>.  Look for them at
+<ulink url="http://www.zlib.org">http://www.zlib.org</ulink> and
 <ulink url="http://www.gzip.org">http://www.gzip.org</ulink>
 respectively.</para>
 
 <para>For something faster and lighter still, you might try Markus F
 X J Oberhumer's <computeroutput>LZO</computeroutput> real-time
-compression/decompression library, at 
+compression/decompression library, at
 <ulink url="http://www.oberhumer.com/opensource">http://www.oberhumer.com/opensource</ulink>.</para>
 
 </sect1>
@@ -2897,7 +2913,7 @@ ideas.</para>
 
 <literallayout>Michael Burrows and D. J. Wheeler:
   "A block-sorting lossless data compression algorithm"
-   10th May 1994. 
+   10th May 1994.
    Digital SRC Research Report 124.
    ftp://ftp.digital.com/pub/DEC/SRC/research-reports/SRC-124.ps.gz
    If you have trouble finding it, try searching at the

+ 1 - 1
bzip2.mod/bzip2/docs/meson.build

@@ -2,7 +2,7 @@ build_docs = get_option('docs')
 docs = find_program('xsltproc', required : build_docs).found()
 docs = docs and find_program('perl', required : build_docs).found()
 docs = docs and find_program('xmllint', required : build_docs).found()
-docs = docs and find_program('egrep', required : build_docs).found()
+docs = docs and find_program('grep', required : build_docs).found()
 docs = docs and find_program('pdfxmltex', required : build_docs).found()
 docs = docs and find_program('pdftops', required : build_docs).found()
 prog_sh = find_program('sh', required : build_docs)

+ 5 - 5
bzip2.mod/bzip2/docs/xmlproc.sh

@@ -5,10 +5,10 @@
 #  This file is part of bzip2/libbzip2, a program and library for
 #  lossless, block-sorting data compression.
 #
-#  bzip2/libbzip2 version 1.0.6 of 6 September 2010
+#  bzip2/libbzip2 version 1.1.0 of 6 September 2010
 #  Copyright (C) 1996-2010 Julian Seward <[email protected]>
 #
-#  Please read the WARNING, DISCLAIMER and PATENTS sections in the 
+#  Please read the WARNING, DISCLAIMER and PATENTS sections in the
 #  README file.
 #
 #  This program is released under the terms of the license contained
@@ -60,7 +60,7 @@ export XML_CATALOG_FILES=/etc/xml/catalog
 
 # post-processing tidy up
 cleanup() {
-  echo "Cleaning up: $@" 
+  echo "Cleaning up: $@"
   while [ $# != 0 ]
   do
     arg=$1; shift;
@@ -73,8 +73,8 @@ case $action in
   -v)
    flags='--noout --xinclude --noblanks --postvalid'
    dtd='--dtdvalid http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd'
-   xmllint $flags $dtd $xmlfmtfile 2> $OUT 
-   egrep 'error' $OUT 
+   xmllint $flags $dtd $xmlfmtfile 2> $OUT
+   grep -F 'error' $OUT
    rm $OUT
   ;;
 

+ 6 - 6
bzip2.mod/bzip2/huffman.c

@@ -8,10 +8,10 @@
    This file is part of bzip2/libbzip2, a program and library for
    lossless, block-sorting data compression.
 
-   bzip2/libbzip2 version 1.0.6 of 6 September 2010
+   bzip2/libbzip2 version 1.1.0 of 6 September 2010
    Copyright (C) 1996-2010 Julian Seward <[email protected]>
 
-   Please read the WARNING, DISCLAIMER and PATENTS sections in the 
+   Please read the WARNING, DISCLAIMER and PATENTS sections in the
    README file.
 
    This program is released under the terms of the license contained
@@ -60,7 +60,7 @@
 
 
 /*---------------------------------------------------*/
-void BZ2_hbMakeCodeLengths ( UChar *len, 
+void BZ2_hbMakeCodeLengths ( UChar *len,
                              Int32 *freq,
                              Int32 alphaSize,
                              Int32 maxLen )
@@ -74,7 +74,7 @@ void BZ2_hbMakeCodeLengths ( UChar *len,
 
    Int32 heap   [ BZ_MAX_ALPHA_SIZE + 2 ];
    Int32 weight [ BZ_MAX_ALPHA_SIZE * 2 ];
-   Int32 parent [ BZ_MAX_ALPHA_SIZE * 2 ]; 
+   Int32 parent [ BZ_MAX_ALPHA_SIZE * 2 ];
 
    for (i = 0; i < alphaSize; i++)
       weight[i+1] = (freq[i] == 0 ? 1 : freq[i]) << 8;
@@ -96,7 +96,7 @@ void BZ2_hbMakeCodeLengths ( UChar *len,
       }
 
       AssertH( nHeap < (BZ_MAX_ALPHA_SIZE+2), 2001 );
-   
+
       while (nHeap > 1) {
          n1 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);
          n2 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);
@@ -119,7 +119,7 @@ void BZ2_hbMakeCodeLengths ( UChar *len,
          len[i-1] = j;
          if (j > maxLen) tooLong = True;
       }
-      
+
       if (! tooLong) break;
 
       /* 17 Oct 04: keep-going condition for the following loop used

+ 1 - 1
bzip2.mod/bzip2/makefile.msc

@@ -4,7 +4,7 @@
 # Fixed up by JRS for bzip2-0.9.5d release.
 
 CC=cl
-CFLAGS= -DWIN32 -MD -Ox -D_FILE_OFFSET_BITS=64 -nologo
+CFLAGS= -DWIN32 -DBZ_LCCWIN32 -MD -Ox -D_FILE_OFFSET_BITS=64 -nologo
 RC=rc
 
 OBJS= blocksort.obj  \

+ 8 - 8
bzip2.mod/bzip2/man/bzgrep.1

@@ -5,17 +5,17 @@
 bzgrep, bzfgrep, bzegrep \- search possibly bzip2 compressed files for a regular expression
 .SH SYNOPSIS
 .B bzgrep
-[ grep_options ]
+[ grep options ]
 .BI  [\ -e\ ] " pattern"
 .IR filename ".\|.\|."
 .br
 .B bzegrep
-[ egrep_options ]
+[ grep -E options ]
 .BI  [\ -e\ ] " pattern"
 .IR filename ".\|.\|."
 .br
 .B bzfgrep
-[ fgrep_options ]
+[ grep -F options ]
 .BI  [\ -e\ ] " pattern"
 .IR filename ".\|.\|."
 .SH DESCRIPTION
@@ -36,9 +36,9 @@ is invoked as
 or
 .I bzfgrep
 then
-.I egrep
+.I grep -E
 or
-.I fgrep
+.I grep -F
 is used instead of
 .I grep.
 If the GREP environment variable is set,
@@ -47,10 +47,10 @@ uses it as the
 .I grep
 program to be invoked. For example:
 
-    for sh:  GREP=fgrep  bzgrep string files
-    for csh: (setenv GREP fgrep; bzgrep string files)
+    for sh:  GREP="grep -F" bzgrep string files
+    for csh: (setenv GREP "grep -F"; bzgrep string files)
 .SH AUTHOR
 Charles Levert ([email protected]). Adapted to bzip2 by Philippe
 Troin <[email protected]> for Debian GNU/Linux.
 .SH "SEE ALSO"
-grep(1), egrep(1), fgrep(1), bzdiff(1), bzmore(1), bzless(1), bzip2(1)
+grep(1), bzdiff(1), bzmore(1), bzless(1), bzip2(1)

+ 93 - 72
bzip2.mod/bzip2/man/bzip2.1

@@ -1,4 +1,3 @@
-.PU
 .TH bzip2 1
 .SH NAME
 bzip2, bunzip2 \- a block-sorting file compressor, v1.0.6
@@ -14,20 +13,29 @@ bzip2recover \- recovers data from damaged bzip2 files
 [
 .I "filenames \&..."
 ]
+.br
+.B bzip2
+.RB [ " \-h|\-\-help " ]
 .ll -8
 .br
 .B bunzip2
 .RB [ " \-fkvsVL " ]
-[ 
+[
 .I "filenames \&..."
 ]
 .br
+.B bunzip2
+.RB [ " \-h|\-\-help " ]
+.br
 .B bzcat
 .RB [ " \-s " ]
-[ 
+[
 .I "filenames \&..."
 ]
 .br
+.B bzcat
+.RB [ " \-h|\-\-help " ]
+.br
 .B bzip2recover
 .I "filename"
 
@@ -39,15 +47,15 @@ generally considerably better than that achieved by more conventional
 LZ77/LZ78-based compressors, and approaches the performance of the PPM
 family of statistical compressors.
 
-The command-line options are deliberately very similar to 
-those of 
-.I GNU gzip, 
+The command-line options are deliberately very similar to
+those of
+.I GNU gzip,
 but they are not identical.
 
 .I bzip2
 expects a list of file names to accompany the
 command-line flags.  Each file is replaced by a compressed version of
-itself, with the name "original_name.bz2".  
+itself, with the name "original_name.bz2".
 Each compressed file
 has the same modification date, permissions, and, when possible,
 ownership as the corresponding original, so that these properties can
@@ -74,13 +82,13 @@ incomprehensible and therefore pointless.
 
 .I bunzip2
 (or
-.I bzip2 \-d) 
+.I bzip2 \-d)
 decompresses all
-specified files.  Files which were not created by 
+specified files.  Files which were not created by
 .I bzip2
-will be detected and ignored, and a warning issued.  
+will be detected and ignored, and a warning issued.
 .I bzip2
-attempts to guess the filename for the decompressed file 
+attempts to guess the filename for the decompressed file
 from that of the compressed file as follows:
 
        filename.bz2    becomes   filename
@@ -89,13 +97,13 @@ from that of the compressed file as follows:
        filename.tbz    becomes   filename.tar
        anyothername    becomes   anyothername.out
 
-If the file does not end in one of the recognised endings, 
-.I .bz2, 
-.I .bz, 
+If the file does not end in one of the recognised endings,
+.I .bz2,
+.I .bz,
 .I .tbz2
 or
-.I .tbz, 
-.I bzip2 
+.I .tbz,
+.I bzip2
 complains that it cannot
 guess the name of the original file, and uses the original name
 with
@@ -103,25 +111,25 @@ with
 appended.
 
 As with compression, supplying no
-filenames causes decompression from 
+filenames causes decompression from
 standard input to standard output.
 
-.I bunzip2 
+.I bunzip2
 will correctly decompress a file which is the
 concatenation of two or more compressed files.  The result is the
 concatenation of the corresponding uncompressed files.  Integrity
-testing (\-t) 
-of concatenated 
+testing (\-t)
+of concatenated
 compressed files is also supported.
 
 You can also compress or decompress files to the standard output by
 giving the \-c flag.  Multiple files may be compressed and
 decompressed like this.  The resulting outputs are fed sequentially to
-stdout.  Compression of multiple files 
+stdout.  Compression of multiple files
 in this manner generates a stream
 containing multiple compressed file representations.  Such a stream
 can be decompressed correctly only by
-.I bzip2 
+.I bzip2
 version 0.9.0 or
 later.  Earlier versions of
 .I bzip2
@@ -130,7 +138,7 @@ the first file in the stream.
 
 .I bzcat
 (or
-.I bzip2 -dc) 
+.I bzip2 -dc)
 decompresses all specified files to
 the standard output.
 
@@ -140,10 +148,10 @@ will read arguments from the environment variables
 and
 .I BZIP,
 in that order, and will process them
-before any arguments read from the command line.  This gives a 
+before any arguments read from the command line.  This gives a
 convenient way to supply default arguments.
 
-Compression is always performed, even if the compressed 
+Compression is always performed, even if the compressed
 file is slightly
 larger than the original.  Files of less than about one hundred bytes
 tend to get larger, since the compression mechanism has a constant
@@ -151,9 +159,8 @@ overhead in the region of 50 bytes.  Random data (including the output
 of most file compressors) is coded at about 8.05 bits per byte, giving
 an expansion of around 0.5%.
 
-As a self-check for your protection, 
-.I 
-bzip2
+As a self-check for your protection,
+.I bzip2
 uses 32-bit CRCs to
 make sure that the decompressed version of a file is identical to the
 original.  This guards against corruption of the compressed data, and
@@ -163,13 +170,24 @@ against undetected bugs in
 chances of data corruption going undetected is microscopic, about one
 chance in four billion for each file processed.  Be aware, though, that
 the check occurs upon decompression, so it can only tell you that
-something is wrong.  It can't help you 
+something is wrong.  It can't help you
 recover the original uncompressed
-data.  You can use 
+data.  You can use
 .I bzip2recover
 to try to recover data from
 damaged files.
 
+Unlike
+.I GNU gzip,
+.I bzip2
+will not create a series of
+.I .bz2
+suffixes even when using the
+.I --force
+option:
+
+       filename.bz2    does not become   filename.bz2.bz2
+
 Return values: 0 for a normal exit, 1 for environmental problems (file
 not found, invalid flags, I/O errors, &c), 2 to indicate a corrupt
 compressed file, 3 for an internal consistency error (eg, bug) which
@@ -183,15 +201,15 @@ to panic.
 Compress or decompress to standard output.
 .TP
 .B \-d --decompress
-Force decompression.  
-.I bzip2, 
-.I bunzip2 
+Force decompression.
+.I bzip2,
+.I bunzip2
 and
-.I bzcat 
+.I bzcat
 are
 really the same program, and the decision about what actions to take is
 done on the basis of which name is used.  This flag overrides that
-mechanism, and forces 
+mechanism, and forces
 .I bzip2
 to decompress.
 .TP
@@ -205,10 +223,10 @@ This really performs a trial decompression and throws away the result.
 .TP
 .B \-f --force
 Force overwrite of output files.  Normally,
-.I bzip2 
+.I bzip2
 will not overwrite
-existing output files.  Also forces 
-.I bzip2 
+existing output files.  Also forces
+.I bzip2
 to break hard links
 to files, which it otherwise wouldn't do.
 
@@ -224,9 +242,9 @@ or decompression.
 Reduce memory usage, for compression, decompression and testing.  Files
 are decompressed and tested using a modified algorithm which only
 requires 2.5 bytes per block byte.  This means any file can be
-decompressed in 2300k of memory, albeit at about half the normal speed.
+decompressed in 2300\ k of memory, albeit at about half the normal speed.
 
-During compression, \-s selects a block size of 200k, which limits
+During compression, \-s selects a block size of 200\ k, which limits
 memory use to around the same figure, at the expense of your compression
 ratio.  In short, if your machine is low on memory (8 megabytes or
 less), use \-s for everything.  See MEMORY MANAGEMENT below.
@@ -240,15 +258,18 @@ Verbose mode -- show the compression ratio for each file processed.
 Further \-v's increase the verbosity level, spewing out lots of
 information which is primarily of interest for diagnostic purposes.
 .TP
+.B \-h \-\-help
+Print a help message and exit.
+.TP
 .B \-L --license -V --version
 Display the software version, license terms and conditions.
 .TP
 .B \-1 (or \-\-fast) to \-9 (or \-\-best)
-Set the block size to 100 k, 200 k ..  900 k when compressing.  Has no
+Set the block size to 100 k, 200 k ...  900 k when compressing.  Has no
 effect when decompressing.  See MEMORY MANAGEMENT below.
-The \-\-fast and \-\-best aliases are primarily for GNU gzip 
+The \-\-fast and \-\-best aliases are primarily for GNU gzip
 compatibility.  In particular, \-\-fast doesn't make things
-significantly faster.  
+significantly faster.
 And \-\-best merely selects the default behaviour.
 .TP
 .B \--
@@ -263,7 +284,7 @@ earlier versions, which was sometimes useful.  0.9.5 and above have an
 improved algorithm which renders these flags irrelevant.
 
 .SH MEMORY MANAGEMENT
-.I bzip2 
+.I bzip2
 compresses large files in blocks.  The block size affects
 both the compression ratio achieved, and the amount of memory needed for
 compression and decompression.  The flags \-1 through \-9
@@ -276,13 +297,13 @@ the file.  Since block sizes are stored in compressed files, it follows
 that the flags \-1 to \-9 are irrelevant to and so ignored
 during decompression.
 
-Compression and decompression requirements, 
+Compression and decompression requirements,
 in bytes, can be estimated as:
 
-       Compression:   400k + ( 8 x block size )
+       Compression:   400\ k + ( 8 x block size )
 
-       Decompression: 100k + ( 4 x block size ), or
-                      100k + ( 2.5 x block size )
+       Decompression: 100\ k + ( 4 x block size ), or
+                      100\ k + ( 2.5 x block size )
 
 Larger block sizes give rapidly diminishing marginal returns.  Most of
 the compression comes from the first two or three hundred k of block
@@ -292,10 +313,10 @@ on small machines.
 It is also important to appreciate that the decompression memory
 requirement is set at compression time by the choice of block size.
 
-For files compressed with the default 900k block size,
+For files compressed with the default 900\ k block size,
 .I bunzip2
 will require about 3700 kbytes to decompress.  To support decompression
-of any file on a 4 megabyte machine, 
+of any file on a 4 megabyte machine,
 .I bunzip2
 has an option to
 decompress using approximately half this amount of memory, about 2300
@@ -311,9 +332,9 @@ Another significant point applies to files which fit in a single block
 amount of real memory touched is proportional to the size of the file,
 since the file is smaller than a block.  For example, compressing a file
 20,000 bytes long with the flag -9 will cause the compressor to
-allocate around 7600k of memory, but only touch 400k + 20000 * 8 = 560
-kbytes of it.  Similarly, the decompressor will allocate 3700k but only
-touch 100k + 20000 * 4 = 180 kbytes.
+allocate around 7600\ k of memory, but only touch 400\ k + 20000 * 8 = 560
+kbytes of it.  Similarly, the decompressor will allocate 3700\ k but only
+touch 100\ k + 20000 * 4 = 180 kbytes.
 
 Here is a table which summarises the maximum memory usage for different
 block sizes.  Also recorded is the total compressed size for 14 files of
@@ -337,7 +358,7 @@ larger files, since the Corpus is dominated by smaller files.
 
 .SH RECOVERING DATA FROM DAMAGED FILES
 .I bzip2
-compresses files in blocks, usually 900kbytes long.  Each
+compresses files in blocks, usually 900\ kbytes long.  Each
 block is handled independently.  If a media or transmission error causes
 a multi-block .bz2
 file to become damaged, it may be possible to
@@ -350,36 +371,36 @@ damaged blocks can be distinguished from undamaged ones.
 
 .I bzip2recover
 is a simple program whose purpose is to search for
-blocks in .bz2 files, and write each block out into its own .bz2 
+blocks in .bz2 files, and write each block out into its own .bz2
 file.  You can then use
-.I bzip2 
+.I bzip2
 \-t
 to test the
 integrity of the resulting files, and decompress those which are
 undamaged.
 
 .I bzip2recover
-takes a single argument, the name of the damaged file, 
+takes a single argument, the name of the damaged file,
 and writes a number of files "rec00001file.bz2",
-"rec00002file.bz2", etc, containing the  extracted  blocks.
-The  output  filenames  are  designed  so  that the use of
-wildcards in subsequent processing -- for example,  
-"bzip2 -dc  rec*file.bz2 > recovered_data" -- processes the files in
+"rec00002file.bz2", etc., containing the  extracted  blocks.
+The output filenames are designed so that the use of
+wildcards in subsequent processing -- for example,
+"bzip2 -dc rec*file.bz2 > recovered_data" -- processes the files in
 the correct order.
 
 .I bzip2recover
 should be of most use dealing with large .bz2
-files,  as  these will contain many blocks.  It is clearly
-futile to use it on damaged single-block  files,  since  a
-damaged  block  cannot  be recovered.  If you wish to minimise 
-any potential data loss through media  or  transmission errors, 
+files, as these will contain many blocks.  It is clearly
+futile to use it on damaged single-block files, since a
+damaged block cannot be recovered.  If you wish to minimise
+any potential data loss through media or transmission errors,
 you might consider compressing with a smaller
 block size.
 
 .SH PERFORMANCE NOTES
 The sorting phase of compression gathers together similar strings in the
 file.  Because of this, files containing very long runs of repeated
-symbols, like "aabaabaabaab ..."  (repeated several hundred times) may
+symbols, like "aabaabaabaab ...\&" (repeated several hundred times) may
 compress more slowly than normal.  Versions 0.9.5 and above fare much
 better than previous versions in this respect.  The ratio between
 worst-case and average-case compression time is in the region of 10:1.
@@ -395,7 +416,7 @@ that performance, both for compressing and decompressing, is largely
 determined by the speed at which your machine can service cache misses.
 Because of this, small changes to the code to reduce the miss rate have
 been observed to give disproportionately large performance improvements.
-I imagine 
+I imagine
 .I bzip2
 will perform best on machines with very large caches.
 
@@ -405,8 +426,8 @@ I/O error messages are not as helpful as they could be.
 tries hard to detect I/O errors and exit cleanly, but the details of
 what the problem is sometimes seem rather misleading.
 
-This manual page pertains to version 1.0.6 of
-.I bzip2.  
+This manual page pertains to version 1.1.0 of
+.I bzip2.
 Compressed data created by this version is entirely forwards and
 backwards compatible with the previous public releases, versions
 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, 1.0.2 and above, but with the following
@@ -429,7 +450,7 @@ with MaybeUInt64 set to be an unsigned 64-bit integer.
 .SH AUTHOR
 Julian Seward, [email protected].
 
-https://sourceware.org/bzip2/
+https://gitlab.com/bzip2/bzip2
 
 The ideas embodied in
 .I bzip2
@@ -440,13 +461,13 @@ Fenwick (for the structured coding model in the original
 .I bzip,
 and many refinements), and Alistair Moffat, Radford Neal and Ian Witten
 (for the arithmetic coder in the original
-.I bzip).  
+.I bzip).
 I am much
 indebted for their help, support and advice.  See the manual in the
 source distribution for pointers to sources of documentation.  Christian
 von Roques encouraged me to look for faster sorting algorithms, so as to
 speed up compression.  Bela Lubkin encouraged me to improve the
-worst-case compression performance.  
+worst-case compression performance.
 Donna Robinson XMLised the documentation.
 The bz* scripts are derived from those of GNU gzip.
 Many people sent patches, helped

+ 4 - 4
bzip2.mod/bzip2/man/bzip2.1.preformatted

@@ -348,13 +348,13 @@ CCAAVVEEAATTSS
        but  the  details  of  what  the problem is sometimes seem
        rather misleading.
 
-       This manual page pertains to version 1.0.6 of _b_z_i_p_2_.  Com­
+       This manual page pertains to version 1.1.0 of _b_z_i_p_2_.  Com­
        pressed  data created by this version is entirely forwards
        and  backwards  compatible  with   the   previous   public
-       releases,  versions  0.1pl2,  0.9.0,  0.9.5, 1.0.0, 1.0.1, 
+       releases,  versions  0.1pl2,  0.9.0,  0.9.5, 1.0.0, 1.0.1,
        1.0.2 and above, but with the  following  exception: 0.9.0
        and above can  correctly decompress  multiple concatenated
-       compressed files.  0.1pl2  cannot do this;  it  will  stop 
+       compressed files.  0.1pl2  cannot do this;  it  will  stop
        after  decompressing just the first file in the stream.
 
        _b_z_i_p_2_r_e_c_o_v_e_r  versions prior to 1.0.2 used 32‐bit integers
@@ -374,7 +374,7 @@ CCAAVVEEAATTSS
 AAUUTTHHOORR
        Julian Seward, [email protected].
 
-       https://sourceware.org/bzip2/
+       https://gitlab.com/bzip2/bzip2
 
        The ideas embodied in _b_z_i_p_2 are due to (at least) the fol­
        lowing  people: Michael Burrows and David Wheeler (for the

+ 11 - 4
bzip2.mod/bzip2/meson.build

@@ -1,8 +1,8 @@
 project(
   'bzip2',
   ['c'],
-  version : '1.0.7',
-  meson_version : '>= 0.48.0',
+  version : '1.1.0',
+  meson_version : '>= 0.50.0',
   default_options : ['c_std=c89', 'warning_level=1'],
 )
 
@@ -64,8 +64,13 @@ add_project_arguments(cc.get_supported_arguments([
 
 add_project_arguments('-D_GNU_SOURCE', language : 'c')
 
+os_defines = []
 if host_machine.system() == 'windows'
-  add_project_arguments('-D_WIN32', language : 'c')
+  os_defines += '-DBZ_LCCWIN32=1'
+  os_defines += '-DBZ_UNIX=0'
+else
+  os_defines += '-DBZ_LCCWIN32=0'
+  os_defines += '-DBZ_UNIX=1'
 endif
 
 c_args = []
@@ -93,7 +98,7 @@ bz_sources = ['blocksort.c', 'huffman.c', 'crctable.c', 'randtable.c', 'compress
 ##
 ## KEEP THESE IN SYNC WITH CMakeLists.txt OR STUFF WILL BREAK!
 bz2_lt_current  = 1
-bz2_lt_revision = 7
+bz2_lt_revision = 9
 bz2_lt_age      = 0
 
 bz2_soversion   = bz2_lt_current - bz2_lt_age
@@ -126,6 +131,7 @@ bzip2 = executable(
   ['bzip2.c'],
   link_with : [libbzip2],
   install : true,
+  c_args : os_defines,
 )
 
 executable(
@@ -133,6 +139,7 @@ executable(
   ['bzip2recover.c'],
   link_with : [libbzip2],
   install : true,
+  c_args : os_defines,
 )
 
 ## Install wrapper scripts

+ 2 - 2
bzip2.mod/bzip2/mk251.c

@@ -9,10 +9,10 @@
    This file is part of bzip2/libbzip2, a program and library for
    lossless, block-sorting data compression.
 
-   bzip2/libbzip2 version 1.0.6 of 6 September 2010
+   bzip2/libbzip2 version 1.1.0 of 6 September 2010
    Copyright (C) 1996-2010 Julian Seward <[email protected]>
 
-   Please read the WARNING, DISCLAIMER and PATENTS sections in the 
+   Please read the WARNING, DISCLAIMER and PATENTS sections in the
    README file.
 
    This program is released under the terms of the license contained

+ 54 - 54
bzip2.mod/bzip2/randtable.c

@@ -8,10 +8,10 @@
    This file is part of bzip2/libbzip2, a program and library for
    lossless, block-sorting data compression.
 
-   bzip2/libbzip2 version 1.0.6 of 6 September 2010
+   bzip2/libbzip2 version 1.1.0 of 6 September 2010
    Copyright (C) 1996-2010 Julian Seward <[email protected]>
 
-   Please read the WARNING, DISCLAIMER and PATENTS sections in the 
+   Please read the WARNING, DISCLAIMER and PATENTS sections in the
    README file.
 
    This program is released under the terms of the license contained
@@ -23,58 +23,58 @@
 
 
 /*---------------------------------------------*/
-Int32 BZ2_rNums[512] = { 
-   619, 720, 127, 481, 931, 816, 813, 233, 566, 247, 
-   985, 724, 205, 454, 863, 491, 741, 242, 949, 214, 
-   733, 859, 335, 708, 621, 574, 73, 654, 730, 472, 
-   419, 436, 278, 496, 867, 210, 399, 680, 480, 51, 
-   878, 465, 811, 169, 869, 675, 611, 697, 867, 561, 
-   862, 687, 507, 283, 482, 129, 807, 591, 733, 623, 
-   150, 238, 59, 379, 684, 877, 625, 169, 643, 105, 
-   170, 607, 520, 932, 727, 476, 693, 425, 174, 647, 
-   73, 122, 335, 530, 442, 853, 695, 249, 445, 515, 
-   909, 545, 703, 919, 874, 474, 882, 500, 594, 612, 
-   641, 801, 220, 162, 819, 984, 589, 513, 495, 799, 
-   161, 604, 958, 533, 221, 400, 386, 867, 600, 782, 
-   382, 596, 414, 171, 516, 375, 682, 485, 911, 276, 
-   98, 553, 163, 354, 666, 933, 424, 341, 533, 870, 
-   227, 730, 475, 186, 263, 647, 537, 686, 600, 224, 
-   469, 68, 770, 919, 190, 373, 294, 822, 808, 206, 
-   184, 943, 795, 384, 383, 461, 404, 758, 839, 887, 
-   715, 67, 618, 276, 204, 918, 873, 777, 604, 560, 
-   951, 160, 578, 722, 79, 804, 96, 409, 713, 940, 
-   652, 934, 970, 447, 318, 353, 859, 672, 112, 785, 
-   645, 863, 803, 350, 139, 93, 354, 99, 820, 908, 
-   609, 772, 154, 274, 580, 184, 79, 626, 630, 742, 
-   653, 282, 762, 623, 680, 81, 927, 626, 789, 125, 
-   411, 521, 938, 300, 821, 78, 343, 175, 128, 250, 
-   170, 774, 972, 275, 999, 639, 495, 78, 352, 126, 
-   857, 956, 358, 619, 580, 124, 737, 594, 701, 612, 
-   669, 112, 134, 694, 363, 992, 809, 743, 168, 974, 
-   944, 375, 748, 52, 600, 747, 642, 182, 862, 81, 
-   344, 805, 988, 739, 511, 655, 814, 334, 249, 515, 
-   897, 955, 664, 981, 649, 113, 974, 459, 893, 228, 
-   433, 837, 553, 268, 926, 240, 102, 654, 459, 51, 
-   686, 754, 806, 760, 493, 403, 415, 394, 687, 700, 
-   946, 670, 656, 610, 738, 392, 760, 799, 887, 653, 
-   978, 321, 576, 617, 626, 502, 894, 679, 243, 440, 
-   680, 879, 194, 572, 640, 724, 926, 56, 204, 700, 
-   707, 151, 457, 449, 797, 195, 791, 558, 945, 679, 
-   297, 59, 87, 824, 713, 663, 412, 693, 342, 606, 
-   134, 108, 571, 364, 631, 212, 174, 643, 304, 329, 
-   343, 97, 430, 751, 497, 314, 983, 374, 822, 928, 
-   140, 206, 73, 263, 980, 736, 876, 478, 430, 305, 
-   170, 514, 364, 692, 829, 82, 855, 953, 676, 246, 
-   369, 970, 294, 750, 807, 827, 150, 790, 288, 923, 
-   804, 378, 215, 828, 592, 281, 565, 555, 710, 82, 
-   896, 831, 547, 261, 524, 462, 293, 465, 502, 56, 
-   661, 821, 976, 991, 658, 869, 905, 758, 745, 193, 
-   768, 550, 608, 933, 378, 286, 215, 979, 792, 961, 
-   61, 688, 793, 644, 986, 403, 106, 366, 905, 644, 
-   372, 567, 466, 434, 645, 210, 389, 550, 919, 135, 
-   780, 773, 635, 389, 707, 100, 626, 958, 165, 504, 
-   920, 176, 193, 713, 857, 265, 203, 50, 668, 108, 
-   645, 990, 626, 197, 510, 357, 358, 850, 858, 364, 
+Int32 BZ2_rNums[512] = {
+   619, 720, 127, 481, 931, 816, 813, 233, 566, 247,
+   985, 724, 205, 454, 863, 491, 741, 242, 949, 214,
+   733, 859, 335, 708, 621, 574, 73, 654, 730, 472,
+   419, 436, 278, 496, 867, 210, 399, 680, 480, 51,
+   878, 465, 811, 169, 869, 675, 611, 697, 867, 561,
+   862, 687, 507, 283, 482, 129, 807, 591, 733, 623,
+   150, 238, 59, 379, 684, 877, 625, 169, 643, 105,
+   170, 607, 520, 932, 727, 476, 693, 425, 174, 647,
+   73, 122, 335, 530, 442, 853, 695, 249, 445, 515,
+   909, 545, 703, 919, 874, 474, 882, 500, 594, 612,
+   641, 801, 220, 162, 819, 984, 589, 513, 495, 799,
+   161, 604, 958, 533, 221, 400, 386, 867, 600, 782,
+   382, 596, 414, 171, 516, 375, 682, 485, 911, 276,
+   98, 553, 163, 354, 666, 933, 424, 341, 533, 870,
+   227, 730, 475, 186, 263, 647, 537, 686, 600, 224,
+   469, 68, 770, 919, 190, 373, 294, 822, 808, 206,
+   184, 943, 795, 384, 383, 461, 404, 758, 839, 887,
+   715, 67, 618, 276, 204, 918, 873, 777, 604, 560,
+   951, 160, 578, 722, 79, 804, 96, 409, 713, 940,
+   652, 934, 970, 447, 318, 353, 859, 672, 112, 785,
+   645, 863, 803, 350, 139, 93, 354, 99, 820, 908,
+   609, 772, 154, 274, 580, 184, 79, 626, 630, 742,
+   653, 282, 762, 623, 680, 81, 927, 626, 789, 125,
+   411, 521, 938, 300, 821, 78, 343, 175, 128, 250,
+   170, 774, 972, 275, 999, 639, 495, 78, 352, 126,
+   857, 956, 358, 619, 580, 124, 737, 594, 701, 612,
+   669, 112, 134, 694, 363, 992, 809, 743, 168, 974,
+   944, 375, 748, 52, 600, 747, 642, 182, 862, 81,
+   344, 805, 988, 739, 511, 655, 814, 334, 249, 515,
+   897, 955, 664, 981, 649, 113, 974, 459, 893, 228,
+   433, 837, 553, 268, 926, 240, 102, 654, 459, 51,
+   686, 754, 806, 760, 493, 403, 415, 394, 687, 700,
+   946, 670, 656, 610, 738, 392, 760, 799, 887, 653,
+   978, 321, 576, 617, 626, 502, 894, 679, 243, 440,
+   680, 879, 194, 572, 640, 724, 926, 56, 204, 700,
+   707, 151, 457, 449, 797, 195, 791, 558, 945, 679,
+   297, 59, 87, 824, 713, 663, 412, 693, 342, 606,
+   134, 108, 571, 364, 631, 212, 174, 643, 304, 329,
+   343, 97, 430, 751, 497, 314, 983, 374, 822, 928,
+   140, 206, 73, 263, 980, 736, 876, 478, 430, 305,
+   170, 514, 364, 692, 829, 82, 855, 953, 676, 246,
+   369, 970, 294, 750, 807, 827, 150, 790, 288, 923,
+   804, 378, 215, 828, 592, 281, 565, 555, 710, 82,
+   896, 831, 547, 261, 524, 462, 293, 465, 502, 56,
+   661, 821, 976, 991, 658, 869, 905, 758, 745, 193,
+   768, 550, 608, 933, 378, 286, 215, 979, 792, 961,
+   61, 688, 793, 644, 986, 403, 106, 366, 905, 644,
+   372, 567, 466, 434, 645, 210, 389, 550, 919, 135,
+   780, 773, 635, 389, 707, 100, 626, 958, 165, 504,
+   920, 176, 193, 713, 857, 265, 203, 50, 668, 108,
+   645, 990, 626, 197, 510, 357, 358, 850, 858, 364,
    936, 638
 };
 

+ 4 - 4
bzip2.mod/bzip2/spewG.c

@@ -4,7 +4,7 @@
    support for large files (> 2GB) in a reasonable amount of time.
    I suggest you use the undocumented --exponential option to
    bzip2 when compressing the resulting file; this saves a bit of
-   time.  Note: *don't* bother with --exponential when compressing 
+   time.  Note: *don't* bother with --exponential when compressing
    Real Files; it'll just waste a lot of CPU time :-)
    (but is otherwise harmless).
 */
@@ -13,15 +13,15 @@
    This file is part of bzip2/libbzip2, a program and library for
    lossless, block-sorting data compression.
 
-   bzip2/libbzip2 version 1.0.6 of 6 September 2010
+   bzip2/libbzip2 version 1.1.0 of 6 September 2010
    Copyright (C) 1996-2010 Julian Seward <[email protected]>
 
-   Please read the WARNING, DISCLAIMER and PATENTS sections in the 
+   Please read the WARNING, DISCLAIMER and PATENTS sections in the
    README file.
 
    This program is released under the terms of the license contained
    in the file LICENSE.
-	 ------------------------------------------------------------------ */
+------------------------------------------------------------------ */
 
 
 #define _FILE_OFFSET_BITS 64

+ 39 - 41
bzip2.mod/bzip2/tests/CMakeLists.txt

@@ -1,47 +1,45 @@
-set(sample1 -1 sample1.ref sample1.bz2)
-set(sample2 -1 sample2.ref sample2.bz2)
-set(sample3 -1 sample3.ref sample3.bz2)
+if (ENABLE_APP)
+    set(sample1 -1 sample1.ref sample1.bz2)
+    set(sample2 -2 sample2.ref sample2.bz2)
+    set(sample3 -3 sample3.ref sample3.bz2)
 
-if(WIN32)
-    set(BZIP2_EXE "$<CONFIG>/bzip2.exe")
-else()
-    set(BZIP2_EXE bzip2)
-endif()
 
-foreach(TEST
-    "${sample1}"
-    "${sample2}"
-    "${sample3}"
-)
-    list(GET TEST 0 block_size)
-    list(GET TEST 1 file_name)
-    list(GET TEST 2 zip_name)
-
-    add_test(NAME "compress_${file_name}"
-        COMMAND ${Python3_EXECUTABLE}
-            ${CMAKE_CURRENT_SOURCE_DIR}/runtest.py
-            --mode compress
-            ${CMAKE_BINARY_DIR}/${BZIP2_EXE}
-            ${block_size}
-            ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}
-            ${CMAKE_CURRENT_SOURCE_DIR}/${zip_name}
+    foreach(TEST
+        "${sample1}"
+        "${sample2}"
+        "${sample3}"
     )
-endforeach()
+        list(GET TEST 0 block_size)
+        list(GET TEST 1 file_name)
+        list(GET TEST 2 zip_name)
 
-foreach(TEST
-    "${sample1}"
-    "${sample2}"
-    "${sample3}"
-)
-list(GET TEST 0 block_size)
-list(GET TEST 1 file_name)
+        add_test(NAME "compress_${file_name}"
+            COMMAND ${Python3_EXECUTABLE}
+                ${CMAKE_CURRENT_SOURCE_DIR}/runtest.py
+                --mode compress
+                $<TARGET_FILE:bzip2>
+                ${block_size}
+                ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}
+                ${CMAKE_CURRENT_SOURCE_DIR}/${zip_name}
+        )
+    endforeach()
 
-    add_test(NAME "decompress_${file_name}"
-        COMMAND ${Python3_EXECUTABLE}
-            ${CMAKE_CURRENT_SOURCE_DIR}/runtest.py
-            --mode decompress
-            ${CMAKE_BINARY_DIR}/${BZIP2_EXE}
-            ${block_size}
-            ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}
+    foreach(TEST
+        "${sample1}"
+        "${sample2}"
+        "${sample3}"
     )
-endforeach()
+    list(GET TEST 0 block_size)
+    list(GET TEST 1 file_name)
+
+        add_test(NAME "decompress_${file_name}"
+            COMMAND ${Python3_EXECUTABLE}
+                ${CMAKE_CURRENT_SOURCE_DIR}/runtest.py
+                --mode decompress
+                $<TARGET_FILE:bzip2>
+                ${block_size}
+                ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}
+        )
+    endforeach()
+
+endif(ENABLE_APP)

+ 2 - 2
bzip2.mod/bzip2/tests/meson.build

@@ -5,7 +5,7 @@ foreach t : [['-1', 'sample1.ref', 'sample1.bz2'],
              ['-2', 'sample2.ref', 'sample2.bz2'],
              ['-3', 'sample3.ref', 'sample3.bz2']]
   test(
-    t[1],
+    t[1] + ' (compress)',
     prog_python,
     args : [files('runtest.py'), '--mode', 'compress', bzip2, t[0], files(t[1]), files(t[2])],
   )
@@ -16,7 +16,7 @@ foreach t : [['-1', 'sample1.ref'],
              ['-2', 'sample2.ref'],
              ['-3', 'sample3.ref']]
   test(
-    t[1],
+    t[1] + ' (decompress)',
     prog_python,
     args : [files('runtest.py'), '--mode', 'decompress', bzip2, t[0], files(t[1])],
   )

+ 103 - 4
bzip2.mod/bzip2/tests/runtest.py

@@ -1,6 +1,7 @@
 #!/usr/bin/env python3
 
 import argparse
+import os
 import subprocess
 import sys
 
@@ -19,6 +20,67 @@ def main() -> None:
     else:
         test_decompress(args)
 
+def get_slice(data, line_no, size):
+    if len(data) / size > line_no:
+        return data[line_no:line_no + size]
+    elif len(data) / size == line_no:
+        return data[line_no:line_no + len(data) % size]
+    else:
+        return []
+
+def print_binary(data, size):
+    '''
+    Print hex
+    '''
+    lines = int(len(data) / size)
+
+    def render_slice(to_print, size):
+        line = ''
+        for byte in range(0, size):
+            if byte == size / 2:
+                line += ' '
+            if byte < len(to_print):
+                line += '{:02x}'.format(to_print[byte])
+            else:
+                line += '   '
+        return line
+
+    for line in range(0, lines):
+        print(render_slice(get_slice(data, line, size), size))
+    print('')
+
+def print_binary_compare(actual, expected, size):
+    '''
+    Print hex comparison of two buffers
+    '''
+    a_lines = int(len(actual) / size)
+    e_lines = int(len(expected) / size)
+    lines = max(a_lines, e_lines)
+
+    def render_slice(to_print, to_compare):
+        line = ''
+        for byte in range(0, size):
+            if byte == size / 2:
+                line += ' '
+            if byte < len(to_print):
+                if byte >= len(to_compare) or to_print[byte] != to_compare[byte]:
+                    line += '\x1b[1;33m{:02x}\x1b[0m'.format(to_print[byte])  # bold yellow
+                else:
+                    line += '{:02x}'.format(to_print[byte])                   # plain
+            else:
+                line += '  '
+        return line
+
+    for line in range(0, lines):
+        a_line = get_slice(actual, line, size)
+        e_line = get_slice(expected, line, size)
+        text_line = '{}  {}'.format(
+            render_slice(a_line, e_line),
+            render_slice(e_line, a_line)
+        )
+        print(text_line)
+    print('')
+
 
 def test_compress(args: argparse.Namespace) -> None:
     with open(args.reference, 'rb') as f:
@@ -27,11 +89,26 @@ def test_compress(args: argparse.Namespace) -> None:
     with open(args.input, 'rb') as f:
         input_ = f.read()
 
+    command = '{bzip2} {arg}'.format(
+        bzip2=args.bzip2,
+        arg=args.bzip_arg
+    )
+
+    print('\nRunning:  {}\n  with {} bytes of input from {}\n'.format(command, len(input_), args.input))
+
     p = subprocess.run(
-        [args.bzip2, args.bzip_arg],
+        command.split(' '),
         stdout=subprocess.PIPE,
         input=input_)
     if p.returncode != 0:
+        print('bzip2 failed to run')
+        sys.exit(1)
+
+    actual = p.stdout
+    if actual != expected:
+        print('comparison of actual and expected output failed')
+        print(' actual:' + ' ' * 60 + 'expected:')
+        print_binary_compare(actual, expected, 32)
         sys.exit(1)
 
 
@@ -44,17 +121,39 @@ def test_decompress(args: argparse.Namespace) -> None:
         stdout=subprocess.PIPE,
         input=input_)
     if p.returncode != 0:
-        sys.exit(2)
+        print('bzip2 failed to compress')
+        sys.exit(1)
     compressed = p.stdout
     dargs = '-d' if args.bzip_arg != '-3' else '-ds'
+
+    command = '{bzip2} {arg}'.format(
+        bzip2=args.bzip2,
+        arg=dargs
+    )
+
+    print('\nRunning:  {}\n  with {} bytes of input from {}\n'.format(command, len(input_), args.input))
+
     p = subprocess.run(
-        [args.bzip2, dargs],
+        command.split(' '),
         stdout=subprocess.PIPE,
         input=compressed,
     )
     if p.returncode != 0:
+        print('bzip2 failed to decompress')
+        sys.exit(1)
+
+    actual = p.stdout
+    if input_ != actual:
+        print('comparison of actual and expected output failed')
+        print(' actual:' + ' ' * 60 + 'input:')
+        print_binary_compare(actual, input_, 32)
         sys.exit(1)
 
 
 if __name__ == "__main__":
-    main()
+
+    # Prevent OS environment variables from affecting the test suite.
+    os.environ.pop('BZIP', None)
+    os.environ.pop('BZIP2', None)
+
+    main()

+ 7 - 7
bzip2.mod/bzip2/unzcrash.c

@@ -1,11 +1,11 @@
 
 /* A test program written to test robustness to decompression of
-   corrupted data.  Usage is 
+   corrupted data.  Usage is
        unzcrash filename
    and the program will read the specified file, compress it (in memory),
    and then repeatedly decompress it, each time with a different bit of
    the compressed data inverted, so as to test all possible one-bit errors.
-   This should not cause any invalid memory accesses.  If it does, 
+   This should not cause any invalid memory accesses.  If it does,
    I want to know about it!
 
    PS.  As you can see from the above description, the process is
@@ -17,10 +17,10 @@
    This file is part of bzip2/libbzip2, a program and library for
    lossless, block-sorting data compression.
 
-   bzip2/libbzip2 version 1.0.6 of 6 September 2010
+   bzip2/libbzip2 version 1.1.0 of 6 September 2010
    Copyright (C) 1996-2010 Julian Seward <[email protected]>
 
-   Please read the WARNING, DISCLAIMER and PATENTS sections in the 
+   Please read the WARNING, DISCLAIMER and PATENTS sections in the
    README file.
 
    This program is released under the terms of the license contained
@@ -115,9 +115,9 @@ int main ( int argc, char** argv )
            return 1;
          } else {
            for (i = 0; i < nOut; i++)
-             if (inbuf[i] != outbuf[i]) { 
-                fprintf(stderr, "mismatch at %d\n", i ); 
-                return 1; 
+             if (inbuf[i] != outbuf[i]) {
+                fprintf(stderr, "mismatch at %d\n", i );
+                return 1;
            }
            if (i == nOut) fprintf(stderr, "really ok!\n" );
          }

+ 3 - 3
bzip2.mod/bzip2/version.rc

@@ -20,9 +20,9 @@ BEGIN
       BLOCK "040904b0"
       BEGIN
           // VALUE "Comments", "\0"
-          VALUE "CompanyName", "bzip2, https://gitlab.com/federicomenaquintero/bzip2\0"
+          VALUE "CompanyName", "bzip2, https://gitlab.com/bzip2/bzip2\0"
           VALUE "FileDescription", "bzip2\0"
-          VALUE "FileVersion", "1.0.7\0"
+          VALUE "FileVersion", "1.1.0\0"
 #if defined(BZ21DLL)
           VALUE "InternalName", "bz2-1\0"
           VALUE "OriginalFilename", "bz2-1.dll\0"
@@ -37,7 +37,7 @@ BEGIN
           // VALUE "LegalTrademarks", "\0"
           // VALUE "PrivateBuild", "\0"
           VALUE "ProductName", "bzip2\0"
-          VALUE "ProductVersion", "1.0.7\0"
+          VALUE "ProductVersion", "1.1.0\0"
           // VALUE "SpecialBuild", "\0"
       END
     END

+ 2 - 2
bzip2.mod/bzip2/version.rc.in

@@ -27,7 +27,7 @@ BEGIN
       BLOCK "040904b0"
       BEGIN
           // VALUE "Comments", ""
-          VALUE "CompanyName", "bzip2, http://www.bzip.org/"
+          VALUE "CompanyName", "bzip2, https://gitlab.com/bzip2/bzip2"
           VALUE "FileDescription", "bzip2"
           VALUE "FileVersion", "1.0.6"
 #if defined(LIBBZ2)
@@ -40,7 +40,7 @@ BEGIN
           VALUE "InternalName", "bzip2recover"
           VALUE "OriginalFilename", "bzip2recover.exe"
 #endif
-          VALUE "LegalCopyright", "Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>. All rights reserved."
+          VALUE "LegalCopyright", "Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>. All rights reserved."
           VALUE "LegalTrademarks", ""
           VALUE "ProductName", "bzip2"
           VALUE "ProductVersion", "1.0.6"

+ 1 - 1
bzip2.mod/include/bz_version.h

@@ -1 +1 @@
-#define BZ_VERSION "1.0.7"
+#define BZ_VERSION "1.1.0"

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott