From 77260b26bd76334d4c5d4650c6025d0c95780df2 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 19 Sep 2012 13:59:51 +0000 Subject: 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 --- Master/tlpkg/TeXLive/TLUtils.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Master/tlpkg/TeXLive') 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 = ); + my $firstline = ; 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. -- cgit v1.2.3