r56698 - /trunk/dh-make-perl/lib/DhMakePerl/Command/Packaging.pm

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Fri Apr 23 13:18:29 UTC 2010


Author: dmn
Date: Fri Apr 23 13:18:16 2010
New Revision: 56698

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=56698
Log:
fix usage of uninitialised variable when description cannot be determined

thanks to carnil

Modified:
    trunk/dh-make-perl/lib/DhMakePerl/Command/Packaging.pm

Modified: trunk/dh-make-perl/lib/DhMakePerl/Command/Packaging.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/DhMakePerl/Command/Packaging.pm?rev=56698&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/DhMakePerl/Command/Packaging.pm (original)
+++ trunk/dh-make-perl/lib/DhMakePerl/Command/Packaging.pm Fri Apr 23 13:18:16 2010
@@ -509,15 +509,17 @@
         $my_desc =~ s/\n.*$//s;
         $desc = $my_desc;
     }
-    else {
-        # have a fall-back for the short description
-        $desc = '(no short description found)';
-    }
-
-    # Replace linefeeds (not followed by a space) in short description with
-    # spaces
-    $desc =~ s/\n(?=\S)/ /gs;
-    $desc =~ s/^\s+//;      # strip leading spaces
+
+    if ( defined($desc) ) {
+        # Replace linefeeds (not followed by a space) in short description with
+        # spaces
+        $desc =~ s/\n(?=\S)/ /gs;
+        $desc =~ s/^\s+//;      # strip leading spaces
+    }
+
+    # have a fall-back for the short description
+    $desc ||= '(no short description found)';
+
     $bin->short_description($desc);
 
     my $long_desc;




More information about the Pkg-perl-cvs-commits mailing list