commit bash-20151113 snapshot

This commit is contained in:
Chet Ramey
2015-12-01 11:28:06 -05:00
parent f542be5d52
commit f9b024c839
15 changed files with 148 additions and 49 deletions
+8
View File
@@ -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));
}