summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2012-09-19 13:59:51 +0000
committerNorbert Preining <preining@logic.at>2012-09-19 13:59:51 +0000
commit77260b26bd76334d4c5d4650c6025d0c95780df2 (patch)
tree426856199072cad50d4f42a5620f085d5fa7acec /Master
parent2e25b08f0ab9ab9990d25fc9125ff3d7b5687e96 (diff)
make sure that we get a first line even on cygwin which returns undef
when reading from an empty file git-svn-id: svn://tug.org/texlive/trunk@27741 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index 65a60dfde6e..9b4f995e87b 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -2692,8 +2692,12 @@ sub check_for_old_updmap_cfg {
return unless -r $oldupd; # if no such file, good.
open (OLDUPD, "<$oldupd") || die "open($oldupd) failed: $!";
- chomp( my $firstline = <OLDUPD> );
+ my $firstline = <OLDUPD>;
close(OLDUPD);
+ # cygwin returns undef when reading from an empty file, we have
+ # to make sure that this is anyway initialized
+ $firstline = "" if (!defined($firstline));
+ chomp ($firstline);
#
if ($firstline =~ m/^# Generated by (install-tl|.*\/tlmgr) on/) {
# assume it was our doing, rename it.