git: 89f872ec2ccf - main - archivers/pbzip2: fix stream decompression after libc++ 19 fix

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Fri, 27 Dec 2024 21:25:16 UTC
The branch main has been updated by dim:

URL: https://cgit.FreeBSD.org/ports/commit/?id=89f872ec2ccf488f24cd9daca2e0d1f80e7ee429

commit 89f872ec2ccf488f24cd9daca2e0d1f80e7ee429
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-12-27 21:15:48 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-12-27 21:24:55 +0000

    archivers/pbzip2: fix stream decompression after libc++ 19 fix
    
    The patch in bug 283655 to fix the pbzip2 build against libc++ 19 (which
    finally removed std::char_traits<unsigned char>) had a problem where it
    did not correctly check the bzip2 header. This only occurred when
    decompressing from standard input, in the 'BZ2StreamScanner' mode, and
    would then throw an unexpected "invalid file format" error.
    
    PR:             283655
    Reported by:    wosch
    MFH:            2024Q4
---
 archivers/pbzip2/files/patch-BZ2StreamScanner.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/archivers/pbzip2/files/patch-BZ2StreamScanner.cpp b/archivers/pbzip2/files/patch-BZ2StreamScanner.cpp
index e6a3d82b789c..070f227c7ec1 100644
--- a/archivers/pbzip2/files/patch-BZ2StreamScanner.cpp
+++ b/archivers/pbzip2/files/patch-BZ2StreamScanner.cpp
@@ -1,4 +1,4 @@
---- BZ2StreamScanner.cpp.orig	2024-11-03 23:01:39 UTC
+--- BZ2StreamScanner.cpp.orig	2015-12-17 23:32:49 UTC
 +++ BZ2StreamScanner.cpp
 @@ -49,8 +49,8 @@ int BZ2StreamScanner::init( int hInFile, size_t inBuff
  
@@ -36,7 +36,7 @@
 -				int cmpres = pHdr->compare( hsp, pHdr->size() - hsp,
 -						getInBuffSearchPtr() + hsp, pHdr->size() - hsp );
 +				bool cmpres = equal( pHdr->begin() + hsp, pHdr->begin() + pHdr->size() - hsp,
-+						getInBuffSearchPtr() );
++						getInBuffSearchPtr() + hsp );
  
 +
  				#ifdef PBZIP_DEBUG