Procházet zdrojové kódy

update-alternatives: Check for undefined values when reading from the db

Guillem Jover před 18 roky
rodič
revize
8baa694e54
3 změnil soubory, kde provedl 8 přidání a 1 odebrání
  1. 4 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 2 1
      scripts/update-alternatives.pl

+ 4 - 0
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.

+ 2 - 0
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)

+ 2 - 1
scripts/update-alternatives.pl

@@ -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]));
     $_;
 }