Mercurial > hg > octave-thorsten
diff libinterp/interpfcn/toplev.cc @ 15311:b516da00c5e4 draft
don't insert unknonwn parameters in internal octave_config_info struct
* toplev.cc (Foctave_config_info): Check that field exists before
attempting to access contents.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 05 Sep 2012 20:22:20 -0400 |
parents | 648dabbb4c6b |
children |
line wrap: on
line diff
--- a/libinterp/interpfcn/toplev.cc +++ b/libinterp/interpfcn/toplev.cc @@ -1474,12 +1474,17 @@ if (! error_state) { - Cell c = m.contents (arg.c_str ()); + if (m.isfield (arg)) + { + Cell c = m.contents (arg); - if (c.is_empty ()) - error ("octave_config_info: no info for `%s'", arg.c_str ()); + if (c.is_empty ()) + error ("octave_config_info: no info for `%s'", arg.c_str ()); + else + retval = c(0); + } else - retval = c(0); + error ("octave_config_info: invalid parameter `%s'", arg.c_str ()); } } else if (nargin == 0)