From: Jarkko Hietaniemi Date: Mon, 7 Jul 2003 13:31:14 +0000 (+0000) Subject: Returning zero from PerlIO_read() is okay; X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ef3aad6271d16a39465a0b656ec0882569b532cb;p=p5sagit%2Fp5-mst-13.2.git Returning zero from PerlIO_read() is okay; update MD5 sums. p4raw-id: //depot/perl@20056 --- diff --git a/ext/Digest/MD5/MD5.xs b/ext/Digest/MD5/MD5.xs index 5c90f22..9b60753 100644 --- a/ext/Digest/MD5/MD5.xs +++ b/ext/Digest/MD5/MD5.xs @@ -633,12 +633,8 @@ addfile(self, fh) n = PerlIO_read(fh, buffer, missing); if (n >= 0) MD5Update(context, buffer, n); - else { - if (PerlIO_error(fh)) { - croak("Reading from filehandle failed"); - } + else XSRETURN(1); /* self */ - } } /* Process blocks until EOF or error */ @@ -646,7 +642,7 @@ addfile(self, fh) MD5Update(context, buffer, n); } - if (PerlIO_error(fh)) { + if (n < 0 && PerlIO_error(fh)) { croak("Reading from filehandle failed"); } } diff --git a/ext/Digest/MD5/t/files.t b/ext/Digest/MD5/t/files.t index 24ef6d1..08cd51b 100644 --- a/ext/Digest/MD5/t/files.t +++ b/ext/Digest/MD5/t/files.t @@ -23,7 +23,7 @@ if (ord "A" == 193) { # EBCDIC fcc48d6bb88ca8065bf9ddfcb9e7483e Changes 0565ec21b15c0f23f4c51fb327c8926d README 1965beb0e48253b694220fbb5d6230f5 MD5.pm -604944842f1a23778f00fed5ca45b17f MD5.xs +339e7a6915dcd67ff5bb583a7568fbb6 MD5.xs 276da0aa4e9a08b7fe09430c9c5690aa rfc1321.txt EOT } elsif ("\n" eq "\015") { # MacOS @@ -31,7 +31,7 @@ EOT f161f474603c54a0093ad2f6f93be33b Changes 6c950a0211a5a28f023bb482037698cd README 18178c90bc13d6824f6c96973b6e9433 MD5.pm -5b88336d811edee7de8648d86d498b6e MD5.xs +1f004206b000efac36e9890aac6f0281 MD5.xs 754b9db19f79dbc4992f7166eb0f37ce rfc1321.txt EOT } else { @@ -40,7 +40,7 @@ EOT 029fa5059ba0b2175cee09ab5d9b7b73 Changes 6c950a0211a5a28f023bb482037698cd README 18178c90bc13d6824f6c96973b6e9433 MD5.pm -5b88336d811edee7de8648d86d498b6e MD5.xs +1f004206b000efac36e9890aac6f0281 MD5.xs 754b9db19f79dbc4992f7166eb0f37ce rfc1321.txt EOT }