# HG changeset patch # User John W. Eaton # Date 1287814976 14400 # Node ID 69b2f237060e9209e6334add5a177a85752a3de2 # Parent 3735abe5ebbe7f1a2ebd610e905243b676291e89 file-io.cc (Ffopen): argument parsing tweak diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-10-23 John W. Eaton + + * file-io.cc (Ffopen): Only handle fopen ("all") case if nargout + is 0 or 1. + 2010-10-22 John W. Eaton * octave.cc (usage): Put whitespace before and after usage message. diff --git a/src/file-io.cc b/src/file-io.cc --- a/src/file-io.cc +++ b/src/file-io.cc @@ -554,7 +554,7 @@ return retval; } -DEFUN (fopen, args, , +DEFUN (fopen, args, nargout, "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{fid}, @var{msg}] =} fopen (@var{name}, @var{mode}, @var{arch})\n\ @deftypefnx {Built-in Function} {@var{fid_list} =} fopen (\"all\")\n\ @@ -664,7 +664,7 @@ if (nargin == 1) { - if (args(0).is_string ()) + if (nargout < 2 && args(0).is_string ()) { // If there is only one argument and it is a string but it // is not the string "all", we assume it is a file to open