From: Guillem Jover Date: Thu, 27 Dec 2007 04:36:58 +0000 (+0200) Subject: update-alternatives: Check for undefined values when reading from the db X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8baa694e542bc579f205de54b9c5c73768737095;p=dpkg update-alternatives: Check for undefined values when reading from the db --- 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])); $_; }