Mercurial > hg > octave-lojdl
changeset 908:efb4cbdaac26
[project @ 1994-11-09 23:03:37 by jwe]
author | jwe |
---|---|
date | Wed, 09 Nov 1994 23:04:29 +0000 |
parents | c37f41df305f |
children | 06bf5c8651ee |
files | src/parse.y src/utils.cc |
diffstat | 2 files changed, 26 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parse.y +++ b/src/parse.y @@ -953,6 +953,8 @@ // file does not match the name of the function stated in the file. // Matlab doesn't provide a diagnostic (it ignores the stated name). + $4->stash_function_name (id_name); + if (reading_fcn_file) { if (strcmp (curr_fcn_file_name, id_name) != 0) @@ -969,6 +971,7 @@ id_name = $1->name (); } + $4->stash_function_name (id_name); $4->stash_fcn_file_name (); $4->stash_fcn_file_time (time (0)); $4->mark_as_system_fcn_file (); @@ -984,8 +987,6 @@ top_level_sym_tab->clear (id_name); - $4->stash_function_name (id_name); - $1->define ($4); $1->document (help_buf);
--- a/src/utils.cc +++ b/src/utils.cc @@ -720,7 +720,17 @@ char * fcn_file_in_path (const char *name) { - return file_in_path (name, ".m"); + if (name) + { + int len = strlen (name); + + if (name [len - 2] == '.' && name [len - 1] == 'm') + return file_in_path (name, ""); + else + return file_in_path (name, ".m"); + } + else + return 0; } // See if there is an octave file in the path. If so, return the @@ -729,7 +739,18 @@ char * oct_file_in_path (const char *name) { - return file_in_path (name, ".oct"); + if (name) + { + int len = strlen (name); + + if (name [len - 4] == '.' && name [len - 3] == 'o' + && name [len - 2] == 'c' && name [len - 1] == 't') + return file_in_path (name, ""); + else + return file_in_path (name, ".oct"); + } + else + return 0; } char *