Mercurial > hg > octave-nkf
diff src/variables.cc @ 8083:16ab78b816bc
variables.cc (mlock): lock current function
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 03 Sep 2008 11:36:11 -0400 |
parents | 85184151822e |
children | 10b63c4fd413 |
line wrap: on
line diff
--- a/src/variables.cc +++ b/src/variables.cc @@ -1888,7 +1888,7 @@ void mlock (void) { - octave_function *fcn = octave_call_stack::caller (); + octave_function *fcn = octave_call_stack::current (); if (fcn) fcn->lock (); @@ -1938,7 +1938,14 @@ octave_value_list retval; if (args.length () == 0) - mlock (); + { + octave_function *fcn = octave_call_stack::caller (); + + if (fcn) + fcn->lock (); + else + error ("mlock: invalid use outside a function"); + } else print_usage ();