summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-07-07 13:31:14 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-07-07 13:31:14 +0000
commitef3aad6271d16a39465a0b656ec0882569b532cb (patch)
tree8caa1dedeeadee243f2978d4c98a3da9c61f7cd6
parentf183cb219ecce20aeebdfc5d56782bfea3310804 (diff)
downloadperl-ef3aad6271d16a39465a0b656ec0882569b532cb.tar.gz
Returning zero from PerlIO_read() is okay;
update MD5 sums. p4raw-id: //depot/perl@20056
-rw-r--r--ext/Digest/MD5/MD5.xs8
-rw-r--r--ext/Digest/MD5/t/files.t6
2 files changed, 5 insertions, 9 deletions
diff --git a/ext/Digest/MD5/MD5.xs b/ext/Digest/MD5/MD5.xs
index 5c90f2238d..9b607538ad 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 24ef6d11b9..08cd51b0b3 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
}