1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## octave3.0.dpatch by Thomas Weber <thomas.weber.mail@gmail.com>
3 ##
4 ## DP: Changes required to switch to octave3.0.
6 @DPATCH@
8 --- a/src/octave/pfsopen.cpp
9 +++ b/src/octave/pfsopen.cpp
10 @@ -54,8 +54,9 @@ DEFUN_DLD( pfsopen, args, , helpString)
11 return retval;
12 }
14 - if( !args(0).is_string() && !args(0).is_stream() ) {
15 + if( !args(0).is_string() && !args(0).is_real_scalar() ) {
16 error( SCRIPT_NAME ": expected file name or file descriptor as the first argument!");
17 + // file descriptors are represented as integers (stored as doubles) in Octave 3.0
18 return retval;
19 }
21 @@ -120,8 +121,7 @@ DEFUN_DLD( pfsopen, args, , helpString)
22 }
23 } else {
24 // File descriptor given
25 - octave_stream fid = args(0).stream_value();
26 - int fd = dup( fid.file_number() );
27 + int fd = dup( (int) args(0).scalar_value() );
28 if( writeMode ) {
29 fh = fdopen( fd, "wb" );
30 if( fh == NULL ) {
31 --- a/src/octave/pfsoctavelum
32 +++ b/src/octave/pfsoctavelum
33 @@ -33,7 +33,7 @@ if( length( argv ) != 1 )
34 error( "Expecting exactly one parameter with octave code to be execuded" );
35 endif
37 -command = argv{1};
38 +command = argv(){1};
40 ## Add missing ';'
41 if( command(length(command)) != ";" )
42 --- a/src/octave/pfsoctavergb
43 +++ b/src/octave/pfsoctavergb
44 @@ -33,7 +33,7 @@ if( length( argv ) != 1 )
45 error( "Expecting exactly one parameter with octave code to be execuded" );
46 endif
48 -command = argv{1};
49 +command = argv(){1};
51 ## Add missing ';'
52 if( command(length(command)) != ";" )