ports/graphics/pfstools/files/epatch-src-octave-pfsopen.cpp
Rong-En Fan 0b6df26f4f - Update to 1.6.4
- Use macro from bsd.sites.mk
- Make configure finds correct bash instead of patching ourselves
- Fix OPTIONS syntax error
- Add extra patch for octave 3.0
- Use octave base in pkg-plist

PR:		ports/121862
Submitted by:	Iouri V. Ivliev <ii at any.com.ru>
Approved by:	maintainer timeout (2 weeks)
2008-04-04 12:30:23 +00:00

23 lines
788 B
C++

--- src/octave/pfsopen.cpp.orig 2006-04-06 12:33:02.000000000 +0000
+++ src/octave/pfsopen.cpp 2008-02-12 10:59:44.000000000 +0000
@@ -54,8 +54,9 @@
return retval;
}
- if( !args(0).is_string() && !args(0).is_stream() ) {
+ if( !args(0).is_string() && !args(0).is_real_scalar() ) {
error( SCRIPT_NAME ": expected file name or file descriptor as the first argument!");
+ // file descriptors are represented as integers (stored as doubles) in Octave 3.0
return retval;
}
@@ -120,8 +121,7 @@
}
} else {
// File descriptor given
- octave_stream fid = args(0).stream_value();
- int fd = dup( fid.file_number() );
+ int fd = dup( (int) args(0).scalar_value() );
if( writeMode ) {
fh = fdopen( fd, "wb" );
if( fh == NULL ) {