Mercurial > octave-nkf
changeset 20533:19617a5b7202 stable
Fix regression in displayed error message for nargin and nargout.
* ov-usr-fcn.cc (nargin, nargout): After printing error message, use
'return retval' to immediately break out of the function.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 22 Sep 2015 03:08:14 -0700 |
parents | 1339ad3c9faa |
children | c0566df8cde3 |
files | libinterp/octave-value/ov-usr-fcn.cc |
diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/octave-value/ov-usr-fcn.cc Tue Sep 22 02:06:17 2015 -0700 +++ b/libinterp/octave-value/ov-usr-fcn.cc Tue Sep 22 03:08:14 2015 -0700 @@ -866,7 +866,10 @@ std::string name = func.string_value (); func = symbol_table::find_function (name); if (func.is_undefined ()) - error ("nargout: invalid function name: %s", name.c_str ()); + { + error ("nargin: invalid function name: %s", name.c_str ()); + return retval; + } } octave_function *fcn_val = func.function_value (); @@ -973,7 +976,10 @@ std::string name = func.string_value (); func = symbol_table::find_function (name); if (func.is_undefined ()) - error ("nargout: invalid function name: %s", name.c_str ()); + { + error ("nargout: invalid function name: %s", name.c_str ()); + return retval; + } } if (func.is_inline_function ())