From 7ed70a72342346925d1dce75335d5cb143a59558 Mon Sep 17 00:00:00 2001 From: nick black Date: Mon, 6 Dec 2021 01:10:14 -0500 Subject: [PATCH] link ncman against zlib --- .drone.yml | 2 +- CMakeLists.txt | 6 ++---- src/man/main.c | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.drone.yml b/.drone.yml index b1a2f99f8..e3953e5da 100644 --- a/.drone.yml +++ b/.drone.yml @@ -96,6 +96,6 @@ steps: - export TERM=xterm - mkdir build - cd build - - cmake -DCMAKE_BUILD_TYPE=Release -DUSE_PANDOC=off .. + - cmake -DCMAKE_BUILD_TYPE=Release -DUSE_PANDOC=off -DUSE_DOCTEST=off -DUSE_DEFLATE=off .. - make -j2 - ctest --output-on-failure diff --git a/CMakeLists.txt b/CMakeLists.txt index e93e99907..1ebb59a2d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -653,16 +653,14 @@ target_include_directories(ncman src "${CMAKE_REQUIRED_INCLUDES}" "${PROJECT_BINARY_DIR}/include" -) -target_include_directories(ncman - BEFORE - PRIVATE "${libdeflate_INCLUDE_DIRS}" + "${ZLIB_INCLUDE_DIRS}" ) target_link_libraries(ncman PRIVATE notcurses-core "${libdeflate}" + "${ZLIB_LIBRARIES}" ) endif() diff --git a/src/man/main.c b/src/man/main.c index eb2d3235a..308a6e4e7 100644 --- a/src/man/main.c +++ b/src/man/main.c @@ -78,7 +78,7 @@ map_gzipped_data(unsigned char* buf, size_t* len, unsigned char* ubuf, uint32_t .zfree = Z_NULL, .opaque = Z_NULL, .next_in = buf, - .avail_in = len, + .avail_in = *len, .next_out = ubuf, .avail_out = ulen, }; @@ -87,7 +87,7 @@ map_gzipped_data(unsigned char* buf, size_t* len, unsigned char* ubuf, uint32_t munmap(buf, *len); return NULL; } - r = inflate(&z, Z_FLUSH); + r = inflate(&z, Z_FINISH); munmap(buf, *len); if(r != Z_STREAM_END){ inflateEnd(&z);