File: 20new.patch

package info (click to toggle)
libterm-readline-gnu-perl 1.35-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 736 kB
  • ctags: 956
  • sloc: perl: 1,293; makefile: 12
file content (13 lines) | stat: -rw-r--r-- 385 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
# 20new.patch by Niko Tyni <ntyni@iki.fi>
# DP: Fix new() argument checking and documentation.
# DP: (#204362, patch by Nicolas Bertolissio)
--- a/Gnu.pm
+++ b/Gnu.pm
@@ -245,6 +245,7 @@ sub new {
     my $this = shift;		# Package
     my $class = ref($this) || $this;
 
+    croak "Wrong number of arguments" unless @_==1 or @_==3;
     my $name = shift;
 
     my $self = \%Attribs;