From b80f6443b6b7b620c7272664c66ecb0b120a0998 Mon Sep 17 00:00:00 2001 From: Jari Aalto Date: Tue, 27 Jul 2004 13:29:18 +0000 Subject: Imported from ../bash-3.0.tar.gz. --- flags.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'flags.c') diff --git a/flags.c b/flags.c index 8846ba30..0c0868bc 100644 --- a/flags.c +++ b/flags.c @@ -40,6 +40,8 @@ extern int set_job_control __P((int)); extern char *shell_name; #endif +extern int shell_initialized; + /* -c, -s invocation options -- not really flags, but they show up in $- */ extern int want_pending_command, read_from_stdin; @@ -151,6 +153,17 @@ int privileged_mode = 0; int brace_expansion = 1; #endif +/* Non-zero means that shell functions inherit the DEBUG trap. */ +int function_trace_mode = 0; + +/* Non-zero means that shell functions inherit the ERR trap. */ +int error_trace_mode = 0; + +/* Non-zero means that the rightmost non-zero exit status in a pipeline + is the exit status of the entire pipeline. If each processes exits + with a 0 status, the status of the pipeline is 0. */ +int pipefail_opt = 0; + /* **************************************************************** */ /* */ /* The Flags ALIST. */ @@ -180,24 +193,22 @@ struct flags_alist shell_flags[] = { { 'u', &unbound_vars_is_error }, { 'v', &echo_input_at_read }, { 'x', &echo_command_at_execute }, - { 'C', &noclobber }, /* New flags that control non-standard things. */ #if 0 { 'l', &lexical_scoping }, #endif - { 'I', &no_invisible_vars }, - - { 'P', &no_symbolic_links }, - #if defined (BRACE_EXPANSION) { 'B', &brace_expansion }, #endif - + { 'C', &noclobber }, + { 'E', &error_trace_mode }, #if defined (BANG_HISTORY) { 'H', &history_expansion }, #endif /* BANG_HISTORY */ - + { 'I', &no_invisible_vars }, + { 'P', &no_symbolic_links }, + { 'T', &function_trace_mode }, {0, (int *)NULL} }; @@ -271,7 +282,7 @@ change_flag (flag, on_or_off) #if defined (RESTRICTED_SHELL) case 'r': - if (on_or_off == FLAG_ON) + if (on_or_off == FLAG_ON && shell_initialized) maybe_make_restricted (shell_name); break; #endif @@ -310,7 +321,7 @@ reset_shell_flags () place_keywords_in_env = read_but_dont_execute = just_one_command = 0; noclobber = unbound_vars_is_error = echo_input_at_read = 0; echo_command_at_execute = jobs_m_flag = forced_interactive = 0; - no_symbolic_links = no_invisible_vars = privileged_mode = 0; + no_symbolic_links = no_invisible_vars = privileged_mode = pipefail_opt = 0; hashing_enabled = interactive_comments = 1; -- cgit v1.2.1