From 8baa694e542bc579f205de54b9c5c73768737095 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 27 Dec 2007 06:36:58 +0200 Subject: [PATCH] update-alternatives: Check for undefined values when reading from the db --- ChangeLog | 4 ++++ debian/changelog | 2 ++ scripts/update-alternatives.pl | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a40ccb24..8158fc5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-12-27 Guillem Jover + + * scripts/update-alternatives.pl (gl): Use defined instead of length. + 2007-12-27 Guillem Jover * scripts/update-alternatives.pl (set_links): New function. diff --git a/debian/changelog b/debian/changelog index d962f664..b2d81868 100644 --- a/debian/changelog +++ b/debian/changelog @@ -39,6 +39,8 @@ dpkg (1.14.13) UNRELEASED; urgency=low [ Guillem Jover ] * Ignore the man pages when building without NLS support. Closes: #457673 + * Fix perl warnings: + - Check for undefined values when reading from the alternative db. [ Updated dpkg translations ] * Swedish (Peter Karlsson) diff --git a/scripts/update-alternatives.pl b/scripts/update-alternatives.pl index 463b61d2..9c1089d6 100755 --- a/scripts/update-alternatives.pl +++ b/scripts/update-alternatives.pl @@ -700,7 +700,8 @@ sub paf { } sub gl { $!=0; $_= ; - length($_) || &quit(sprintf(_g("error or eof reading %s for %s (%s)"), "$admindir/$name", $_[0], $!)); + defined($_) || quit(sprintf(_g("error or eof reading %s for %s (%s)"), + "$admindir/$name", $_[0], $!)); s/\n$// || &badfmt(sprintf(_g("missing newline after %s"), $_[0])); $_; } -- 2.39.5