From e1e4b606b15464a5e57a530dfda74ddfa48715f3 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 27 Jun 2001 13:34:17 +0000 Subject: (openFileMaybeCompressed): make it re-entrant, catch file not readable --- perl-install/common.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/perl-install/common.pm b/perl-install/common.pm index 9b2ace894..9ed9012ff 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -115,7 +115,8 @@ sub unix2dos { local $_ = $_[0]; s/\015$//mg; s/$/\015/mg; $_ } sub openFileMaybeCompressed { my ($f) = @_; -e $f || -e "$f.gz" or die "file $f not found"; - open F, -e $f ? $f : "gzip -dc $f.gz|"; + local *F; + open F, -e $f ? $f : "gzip -dc $f.gz|" or die "file $f is not readable"; *F; } sub catMaybeCompressed { cat__(openFileMaybeCompressed($_[0])) } -- cgit v1.2.1