diff options
| author | Jari Aalto <jari.aalto@cante.net> | 2005-12-07 14:08:12 +0000 |
|---|---|---|
| committer | Jari Aalto <jari.aalto@cante.net> | 2009-09-12 16:46:57 +0000 |
| commit | 95732b497d12c98613bb3c5db16b61f377501a59 (patch) | |
| tree | 5e1cdf79eb0407e09dca4c0ec29e11442c7d1d15 /builtins/evalfile.c | |
| parent | eb87367179effbe5f430236db8259006d71438b7 (diff) | |
| download | android_external_bash-95732b497d12c98613bb3c5db16b61f377501a59.tar.gz android_external_bash-95732b497d12c98613bb3c5db16b61f377501a59.tar.bz2 android_external_bash-95732b497d12c98613bb3c5db16b61f377501a59.zip | |
Imported from ../bash-3.1.tar.gz.
Diffstat (limited to 'builtins/evalfile.c')
| -rw-r--r-- | builtins/evalfile.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/builtins/evalfile.c b/builtins/evalfile.c index c17e547..81be017 100644 --- a/builtins/evalfile.c +++ b/builtins/evalfile.c @@ -39,6 +39,7 @@ #include "../flags.h" #include "../input.h" #include "../execute_cmd.h" +#include "../trap.h" #if defined (HISTORY) # include "../bashhist.h" @@ -82,7 +83,7 @@ _evalfile (filename, flags) size_t file_size; sh_vmsg_func_t *errfunc; #if defined (ARRAY_VARS) - SHELL_VAR *funcname_v, *bash_source_v, *bash_lineno_v; + SHELL_VAR *funcname_v, *nfv, *bash_source_v, *bash_lineno_v; ARRAY *funcname_a, *bash_source_a, *bash_lineno_a; # if defined (DEBUGGER) SHELL_VAR *bash_argv_v, *bash_argc_v; @@ -246,9 +247,16 @@ file_error_and_exit: } #if defined (ARRAY_VARS) + /* These two variables cannot be unset, and cannot be affected by the + sourced file. */ array_pop (bash_source_a); array_pop (bash_lineno_a); - array_pop (funcname_a); + + /* FUNCNAME can be unset, and so can potentially be changed by the + sourced file. */ + GET_ARRAY_FROM_VAR ("FUNCNAME", nfv, funcname_a); + if (nfv == funcname_v) + array_pop (funcname_a); # if defined (DEBUGGER) if ((flags & FEVAL_NOPUSHARGS) == 0) { |
