# HG changeset patch # User jwe # Date 748156894 0 # Node ID 7573fac6f629af5764a71c0eb8f3b5bff437405e # Parent f7408398ed47d14af694e5534830d3bfc4886466 [project @ 1993-09-16 05:21:34 by jwe] (builtin_help): When trying harder to find help for M-files, only insert the symbol into the global symbol table if there really is an M-file of the given name in the path. diff -r f7408398ed47 -r 7573fac6f629 src/t-builtins.cc --- a/src/t-builtins.cc Wed Sep 15 07:29:00 1993 +0000 +++ b/src/t-builtins.cc Thu Sep 16 05:21:34 1993 +0000 @@ -414,6 +414,7 @@ } else { + char *m_file_name = (char *) NULL; symbol_record *sym_rec; help_list *op_help_list = operator_help (); help_list *kw_help_list = keyword_help (); @@ -472,20 +473,23 @@ // appear to be out of date. Don\'t execute commands from the file if // it turns out to be a script file. - sym_rec = global_sym_tab->lookup (argv[i], 1, 0); - if (sym_rec != (symbol_record *) NULL) + m_file_name = m_file_in_path (argv[i]); + if (m_file_name != (char *) NULL) { - tree_identifier tmp (sym_rec); - tmp.parse_m_file (0); - char *h = sym_rec->help (); - if (h != (char *) NULL && *h != '\0') + sym_rec = global_sym_tab->lookup (argv[i], 1, 0); + if (sym_rec != (symbol_record *) NULL) { - output_buf << "\n" << h << "\n"; - goto next; + tree_identifier tmp (sym_rec); + tmp.parse_m_file (0); + char *h = sym_rec->help (); + if (h != (char *) NULL && *h != '\0') + { + output_buf << "\n" << h << "\n"; + goto next; + } } } - else - global_sym_tab->clear (argv[i]); + delete [] m_file_name; output_buf << "Sorry, `" << argv[i] << "' is not documented\n";