summaryrefslogtreecommitdiffstats
path: root/perl-install/common.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-06-27 13:34:17 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-06-27 13:34:17 +0000
commite1e4b606b15464a5e57a530dfda74ddfa48715f3 (patch)
treebc50f7a533a7178d3c6326043798056f50f059d1 /perl-install/common.pm
parent4d21f93e21b57a8804aa724c858e07bacabd83e4 (diff)
downloaddrakx-e1e4b606b15464a5e57a530dfda74ddfa48715f3.tar
drakx-e1e4b606b15464a5e57a530dfda74ddfa48715f3.tar.gz
drakx-e1e4b606b15464a5e57a530dfda74ddfa48715f3.tar.bz2
drakx-e1e4b606b15464a5e57a530dfda74ddfa48715f3.tar.xz
drakx-e1e4b606b15464a5e57a530dfda74ddfa48715f3.zip
(openFileMaybeCompressed): make it re-entrant, catch file not readable
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r--perl-install/common.pm3
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])) }