# HG changeset patch # User Rik # Date 1403798521 25200 # Node ID c677d9bd6bacfc716b798d5fd4770955e4e2c833 # Parent 6825522c25e4ccd3d89cf4f7bb966b99012a4454 exist: Don't look up name in symbol table if "file" or "dir" specified. * variables.cc (symbol_exist): Check that "builtin" or "any" is specified before searching symbol table for name. diff -r 6825522c25e4 -r c677d9bd6bac libinterp/corefcn/variables.cc --- a/libinterp/corefcn/variables.cc Wed Jun 25 15:06:36 2014 -0700 +++ b/libinterp/corefcn/variables.cc Thu Jun 26 09:02:01 2014 -0700 @@ -414,12 +414,13 @@ // We shouldn't need to look in the global symbol table, since any name // that is visible in the current scope will be in the local symbol table. - octave_value val = safe_symbol_lookup (name); - - if (val.is_defined ()) + octave_value val; + + if (search_any || search_builtin) { - if ((search_any || search_builtin) - && val.is_builtin_function ()) + val = safe_symbol_lookup (name); + + if (val.is_defined () && val.is_builtin_function ()) return 5; if (search_builtin)