]> err.no Git - dpkg/commitdiff
update-alternatives: Check for undefined values when reading from the db
authorGuillem Jover <guillem@debian.org>
Thu, 27 Dec 2007 04:36:58 +0000 (06:36 +0200)
committerGuillem Jover <guillem@debian.org>
Thu, 27 Dec 2007 04:36:58 +0000 (06:36 +0200)
ChangeLog
debian/changelog
scripts/update-alternatives.pl

index a40ccb2449ec5b37d7a5f5048347d1483bcbc28f..8158fc5bb1d0187126842d02873b3b0370c53ee2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-12-27  Guillem Jover  <guillem@debian.org>
+
+       * scripts/update-alternatives.pl (gl): Use defined instead of length.
+
 2007-12-27  Guillem Jover  <guillem@debian.org>
 
        * scripts/update-alternatives.pl (set_links): New function.
index d962f664617fcfe733a824f25d63a1e93e053e37..b2d81868be249b8fac1bc0f4d85a6c0aca556017 100644 (file)
@@ -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)
index 463b61d27587a3f52c24b8c294bc6cd751370424..9c1089d63fc8176aee0bd04b0d22ca630110e93b 100755 (executable)
@@ -700,7 +700,8 @@ sub paf {
 }
 sub gl {
     $!=0; $_= <AF>;
-    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]));
     $_;
 }