diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-06-27 13:34:17 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-06-27 13:34:17 +0000 |
commit | e1e4b606b15464a5e57a530dfda74ddfa48715f3 (patch) | |
tree | bc50f7a533a7178d3c6326043798056f50f059d1 | |
parent | 4d21f93e21b57a8804aa724c858e07bacabd83e4 (diff) | |
download | drakx-backup-do-not-use-e1e4b606b15464a5e57a530dfda74ddfa48715f3.tar drakx-backup-do-not-use-e1e4b606b15464a5e57a530dfda74ddfa48715f3.tar.gz drakx-backup-do-not-use-e1e4b606b15464a5e57a530dfda74ddfa48715f3.tar.bz2 drakx-backup-do-not-use-e1e4b606b15464a5e57a530dfda74ddfa48715f3.tar.xz drakx-backup-do-not-use-e1e4b606b15464a5e57a530dfda74ddfa48715f3.zip |
(openFileMaybeCompressed): make it re-entrant, catch file not readable
-rw-r--r-- | perl-install/common.pm | 3 |
1 files changed, 2 insertions, 1 deletions
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])) } |