1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## octave-nargin.dpatch by Sebastian Harl <tokkee@debian.org>
3 ##
4 ## DP: Use nargin instead of length(argv).
5 ## DP:
6 ## DP: length(argv) does not work reliably when no arguments are passed to
7 ## DP: some octave script.
9 @DPATCH@
11 --- a/src/octave/pfsoctavelum
12 +++ b/src/octave/pfsoctavelum
13 @@ -29,7 +29,7 @@
15 #fprintf( stderr, "l = %d\n", length( argv ) );
17 -if( length( argv ) != 1 )
18 +if( nargin != 1 )
19 error( "Expecting exactly one parameter with octave code to be execuded" );
20 endif
22 --- a/src/octave/pfsoctavergb
23 +++ b/src/octave/pfsoctavergb
24 @@ -29,7 +29,7 @@
26 #fprintf( stderr, "l = %d\n", length( argv ) );
28 -if( length( argv ) != 1 )
29 +if( nargin != 1 )
30 error( "Expecting exactly one parameter with octave code to be execuded" );
31 endif
33 --- a/src/octave/pfsstat
34 +++ b/src/octave/pfsstat
35 @@ -29,7 +29,7 @@
37 #fprintf( stderr, "l = %d\n", length( argv ) );
39 -if( length( argv ) != 0 )
40 +if( nargin != 0 )
41 error( "Expecting no parameters" );
42 endif