Mercurial > hg > octave-lojdl
changeset 110:7573fac6f629
[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.
author | jwe |
---|---|
date | Thu, 16 Sep 1993 05:21:34 +0000 |
parents | f7408398ed47 |
children | e4acc68c9c60 |
files | src/t-builtins.cc |
diffstat | 1 files changed, 14 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/src/t-builtins.cc +++ b/src/t-builtins.cc @@ -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";