git: 80fd76960a1b - main - textproc/ugrep: Fix build with archivers/bzip3

From: Ashish SHUKLA <ashish_at_FreeBSD.org>
Date: Tue, 24 Dec 2024 17:45:48 UTC
The branch main has been updated by ashish:

URL: https://cgit.FreeBSD.org/ports/commit/?id=80fd76960a1b0d01a9056405b89cfcfde5a8e413

commit 80fd76960a1b0d01a9056405b89cfcfde5a8e413
Author:     Eric Camachat <eric@camachat.org>
AuthorDate: 2024-12-24 17:37:23 +0000
Commit:     Ashish SHUKLA <ashish@FreeBSD.org>
CommitDate: 2024-12-24 17:44:04 +0000

    textproc/ugrep: Fix build with archivers/bzip3
    
    PR:             283449
    Reviewed by:    ehaupt (maintainer of archivers/bzip3)
---
 textproc/ugrep/files/patch-src_zstream.hpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/textproc/ugrep/files/patch-src_zstream.hpp b/textproc/ugrep/files/patch-src_zstream.hpp
new file mode 100644
index 000000000000..715484065756
--- /dev/null
+++ b/textproc/ugrep/files/patch-src_zstream.hpp
@@ -0,0 +1,11 @@
+--- src/zstream.hpp.orig	2024-11-29 20:51:51 UTC
++++ src/zstream.hpp
+@@ -2626,7 +2626,7 @@ class zstreambuf : public std::streambuf {
+         if (block_size > bz3file_->max ||
+             bz3file_->len > bz3file_->max ||
+             fread(bz3file_->buf, 1, block_size, file_) < block_size ||
+-            bz3_decode_block(bz3file_->strm, bz3file_->buf, block_size, bz3file_->len) < 0)
++            bz3_decode_block(bz3file_->strm, bz3file_->buf, bz3file_->max, block_size, bz3file_->len) < 0)
+         {
+           if (ferror(file_))
+             warning("cannot read", pathname_);