# HG changeset patch # User John W. Eaton # Date 1217270094 14400 # Node ID 77793a0fad3dda0dadf3b82e2b384af45dd2d734 # Parent db5518a14ea47c5c5c408c86faa8dede18b0bfc2 lasterr, lasterror: unwind-protect error_state (transplanted from 736124a4fa3d2fdaf9c97dd5be26c6ab35f8b349) diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2008-07-28 John W. Eaton + + * error.cc (Flasterror, Flasterr): Unwind-protect error_state. + 2008-07-24 John W. Eaton * dirfns.cc (Fmkdir): If directory already exists, return status = diff --git a/src/error.cc b/src/error.cc --- a/src/error.cc +++ b/src/error.cc @@ -1458,6 +1458,11 @@ octave_value retval; int nargin = args.length(); + unwind_protect::begin_frame ("Flasterror"); + + unwind_protect_int (error_state); + error_state = 0; + if (nargin < 2) { Octave_map err; @@ -1582,6 +1587,8 @@ else print_usage (); + unwind_protect::run_frame ("Flasterror"); + return retval; } @@ -1595,6 +1602,11 @@ { octave_value_list retval; + unwind_protect::begin_frame ("Flasterr"); + + unwind_protect_int (error_state); + error_state = 0; + int argc = args.length () + 1; if (argc < 4) @@ -1624,6 +1636,8 @@ else print_usage (); + unwind_protect::run_frame ("Flasterr"); + return retval; }