From bug-request at octave dot org Thu Mar 10 14:25:41 2005 Subject: octave_config_info bug? From: "John W. Eaton" To: "Dmitri A. Sergatskov" Cc: "bug at octave dot org" Date: Thu, 10 Mar 2005 15:32:14 -0500 On 7-Mar-2005, Dmitri A. Sergatskov wrote: | GNU Octave, version 2.1.67 (i686-pc-linux-gnu). | | ... | | octave:1> octave_config_info("junk") | panic: Segmentation fault -- stopping myself... | Segmentation fault | | | It works fine with "legitimate" input or with no input at all: | | octave:1> octave_config_info ("CC") | ans = gcc Please try the following patch. Thanks, jwe src/ChangeLog: 2005-03-10 John W. Eaton * toplev.cc (Foctave_config_info): Print error instead of crashing if struct does not contain field we are looking for. Index: src/toplev.cc =================================================================== RCS file: /usr/local/cvsroot/octave/src/toplev.cc,v retrieving revision 1.153.2.2 diff -u -r1.153.2.2 toplev.cc --- src/toplev.cc 12 Feb 2005 02:29:53 -0000 1.153.2.2 +++ src/toplev.cc 10 Mar 2005 20:23:14 -0000 at @ -798,7 +798,11 @@ if (! error_state) { Cell c = m.contents (arg.c_str ()); - retval = c(0); + + if (c.is_empty ()) + error ("octave_config_info: no info for `%s'", arg.c_str ()); + else + retval = c(0); } } else if (nargin == 0) ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------