# HG changeset patch # User jwe # Date 1179777045 0 # Node ID 379244420c729bac1598a24a71eea99d3ec7c581 # Parent ed74670db09bab85df59f4a867da13c54d7010fb [project @ 2007-05-21 19:50:45 by jwe] diff -r ed74670db09b -r 379244420c72 src/ChangeLog --- a/src/ChangeLog Mon May 21 19:47:22 2007 +0000 +++ b/src/ChangeLog Mon May 21 19:50:45 2007 +0000 @@ -1,3 +1,9 @@ +2007-05-21 David Bateman + + * error.cc (rethrow_error): Use NULL name so that "error:" is not + added to the message + (Frethrow): Correctly treat empty stack. + 2007-05-21 John W. Eaton * oct-map.h (Octave_map::numel): Return number of array elements, diff -r ed74670db09b -r 379244420c72 src/error.cc --- a/src/error.cc Mon May 21 19:47:22 2007 +0000 +++ b/src/error.cc Mon May 21 19:50:45 2007 +0000 @@ -727,7 +727,7 @@ { va_list args; va_start (args, fmt); - error_1 (std::cerr, "error", id, fmt, args); + error_1 (std::cerr, 0, id, fmt, args); va_end (args); } @@ -858,17 +858,20 @@ { Octave_map err_stack = err.contents("stack")(0).map_value (); - if (err_stack.contains ("file")) - file = err_stack.contents("file")(0).string_value (); - - if (err_stack.contains ("name")) - nm = err_stack.contents("name")(0).string_value (); + if (err_stack.numel () > 0) + { + if (err_stack.contains ("file")) + file = err_stack.contents("file")(0).string_value (); - if (err_stack.contains ("line")) - l = err_stack.contents("line")(0).nint_value (); + if (err_stack.contains ("name")) + nm = err_stack.contents("name")(0).string_value (); - if (err_stack.contains ("column")) - c = err_stack.contents("column")(0).nint_value (); + if (err_stack.contains ("line")) + l = err_stack.contents("line")(0).nint_value (); + + if (err_stack.contains ("column")) + c = err_stack.contents("column")(0).nint_value (); + } } // Ugh.