File: 20new.patch

package info (click to toggle)
libterm-readline-gnu-perl 1.24-2~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 556 kB
  • sloc: perl: 1,664; ansic: 112; makefile: 10
file content (22 lines) | stat: -rw-r--r-- 634 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 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
@@ -220,7 +220,7 @@
 
 sub ReadLine { 'Term::ReadLine::Gnu'; }
 
-=item C<new(NAME,[IN[,OUT]])>
+=item C<new(NAME,[IN,OUT])>
 
 returns the handle for subsequent calls to following functions.
 Argument is the name of the application.  Optionally can be followed
@@ -234,6 +234,7 @@
     my $this = shift;		# Package
     my $class = ref($this) || $this;
 
+	croak "Wrong number of arguments" unless @_==1 or @_==3;
     my $name = shift;
 
     my $self = \%Attribs;