Skip Menu |

This queue is for tickets about the Compress-Bzip2 CPAN distribution.

Report information
The Basics
Id: 40741
Status: resolved
Priority: 0/
Queue: Compress-Bzip2

People
Owner: Nobody in particular
Requestors: scg [...] hotmail.ru
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.09
Fixed in: (no value)



Subject: bzreadline blocked on the broken bz2 files
In Bzip2.xs:bzfile_readline() after n = bzfile_read() doing incorrect error check: "if ( n == -1 )". However function bzfile_read() in case of an error returns not only -1. Would be more correct to write: "if ( n < 0 )".
Subject: Bzip2.xs.patch
--- Bzip2.xs.orig Tue Aug 9 21:50:58 2005 +++ Bzip2.xs Fri Nov 7 12:52:38 2008 @@ -1048,7 +1048,7 @@ } else { n = bzfile_read( obj, obj->bufferOfLines, sizeof(obj->bufferOfLines) ); - if ( n == -1 ) { + if ( n < 0 ) { error_num = bzfile_geterrno( obj ); if ( error_num == BZ_IO_ERROR ) {
On Fri Nov 07 05:42:26 2008, scg wrote: Show quoted text
> In Bzip2.xs:bzfile_readline() after n = bzfile_read() doing incorrect > error check: "if ( n == -1 )". However function bzfile_read() in case of > an error returns not only -1. > Would be more correct to write: "if ( n < 0 )".
Yes. There's now also a -2. The upcoming 2.20 will contain the fix in https://github.com/rurban/Compress-Bzip2/commit/a020140a94841d9bef4c06b1c75f858b16e9fbb7 -- Reini Urban