# HG changeset patch # User Rik # Date 1311807932 25200 # Node ID a19b50f6697f62b03441ff03eb31e607aa15c723 # Parent ef5ebbf2a657e1dbed0cd07327a0f77b355453a6 Correctly allow single string input form of fopen() (Bug #33535). * file-io.cc (fopen): Correct nargout check when distinguishing between input filename and special input keyword "all". diff --git a/src/file-io.cc b/src/file-io.cc --- a/src/file-io.cc +++ b/src/file-io.cc @@ -666,14 +666,14 @@ if (nargin == 1) { - if (nargout < 2 && args(0).is_string ()) + if (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 // with MODE = "r". To open a file called "all", you have // to supply more than one argument. - if (args(0).string_value () == "all") + if (nargout < 2 && args(0).string_value () == "all") return octave_stream_list::open_file_numbers (); } else