Mercurial > hg > octave-lyh
diff src/toplev.cc @ 9255:1c2d2c9f4a8d
don't allow quit() in embedded mode by default, make configurable
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Mon, 25 May 2009 15:00:10 +0200 |
parents | ee7cf4d963f3 |
children | 9c2349a51218 |
line wrap: on
line diff
--- a/src/toplev.cc +++ b/src/toplev.cc @@ -81,6 +81,9 @@ void (*octave_exit) (int) = ::exit; +// TRUE means the quit() call is allowed. +bool quit_allowed = true; + // TRUE means we are exiting via the builtin exit or quit functions. static bool quitting_gracefully = false; @@ -654,7 +657,9 @@ { octave_value_list retval; - if (nargout == 0) + if (! quit_allowed) + error ("quit: not supported in embedded mode."); + else if (nargout == 0) { int exit_status = 0;