summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Digest/SHA.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Digest/SHA.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/Digest/SHA.pm12
1 files changed, 7 insertions, 5 deletions
diff --git a/Master/tlpkg/tlperl/lib/Digest/SHA.pm b/Master/tlpkg/tlperl/lib/Digest/SHA.pm
index 2e86d4eea16..dccc0e7aeb3 100644
--- a/Master/tlpkg/tlperl/lib/Digest/SHA.pm
+++ b/Master/tlpkg/tlperl/lib/Digest/SHA.pm
@@ -5,10 +5,10 @@ require 5.003000;
use strict;
use warnings;
use vars qw($VERSION @ISA @EXPORT_OK $errmsg);
-use Fcntl qw(O_RDONLY);
+use Fcntl qw(O_RDONLY O_RDWR);
use integer;
-$VERSION = '6.01';
+$VERSION = '6.02';
require Exporter;
@ISA = qw(Exporter);
@@ -115,11 +115,13 @@ sub addfile {
map { $_ eq $mode } ("b", "U", "0");
## Always interpret "-" to mean STDIN; otherwise use
- ## sysopen to handle full range of POSIX file names
+ ## sysopen to handle full range of POSIX file names.
+ ## If $file is a directory, force an EISDIR error
+ ## by attempting to open with mode O_RDWR
local *FH;
$file eq '-' and open(FH, '< -')
- or sysopen(FH, $file, O_RDONLY)
+ or sysopen(FH, $file, -d $file ? O_RDWR : O_RDONLY)
or _bail('Open failed');
if ($BITS) {
@@ -808,7 +810,7 @@ darkness and moored it in so perfect a calm and in so brilliant a light"
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2003-2017 Mark Shelor
+Copyright (C) 2003-2018 Mark Shelor
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.