mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-12 14:40:50 +02:00
commit bash-20151113 snapshot
This commit is contained in:
@@ -56,6 +56,7 @@
|
||||
|
||||
extern int line_number, current_command_line_count, parser_state;
|
||||
extern int last_command_exit_value;
|
||||
extern int shell_initialized;
|
||||
|
||||
/* Object caching */
|
||||
sh_obj_cache_t wdcache = {0, 0, 0};
|
||||
@@ -793,11 +794,18 @@ make_function_def (name, command, lineno, lstart)
|
||||
if (bash_source_a && array_num_elements (bash_source_a) > 0)
|
||||
temp->source_file = array_reference (bash_source_a, 0);
|
||||
#endif
|
||||
/* Assume that shell functions without a source file before the shell is
|
||||
initialized come from the environment. Otherwise default to "main"
|
||||
(usually functions being defined interactively) */
|
||||
if (temp->source_file == 0)
|
||||
temp->source_file = shell_initialized ? "main" : "environment";
|
||||
|
||||
#if defined (DEBUGGER)
|
||||
bind_function_def (name->word, temp);
|
||||
#endif
|
||||
|
||||
temp->source_file = temp->source_file ? savestring (temp->source_file) : 0;
|
||||
|
||||
return (make_command (cm_function_def, (SIMPLE_COM *)temp));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user