ソースを参照

Fix error handling in changelog/debian.pl

* scripts/changelog/debian.pl: Don't hide failures
inside eval().
* scripts/Dpkg/Changelog.pm (data2rfc822): Don't fail
if argument is undef.
Frank Lichtenheld 18 年 前
コミット
6ec6391d8e
共有2 個のファイルを変更した7 個の追加2 個の削除を含む
  1. 4 2
      scripts/Dpkg/Changelog.pm
  2. 3 0
      scripts/changelog/debian.pl

+ 4 - 2
scripts/Dpkg/Changelog.pm

@@ -573,7 +573,7 @@ specified B<version> itself.
 
 =back
 
-The following options also supported by all output methods but
+The following options are also supported by all output methods but
 don't take version numbers as values:
 
 =over 4
@@ -666,10 +666,12 @@ sub data2rfc822 {
 	}
 
 	return join "\n", @rfc822;
-    } else {
+    } elsif (ref($data)) {
 	my $rfc822_str = $data->output;
 
 	return $rfc822_str;
+    } else {
+	return;
     }
 }
 

+ 3 - 0
scripts/changelog/debian.pl

@@ -124,3 +124,6 @@ if ($file eq '-') {
 
 
 eval("print \$changes->${format}_str(\$opts)");
+if ($@) {
+    failure("%s",$@);
+}