X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=flags.c;h=cdf2aefc8d7d66c8dab91cff0e8ff0f5757587a8;hb=f73dda092b33638d2d5e9c35375f687a607b5403;hp=8d2f7f58443e6378a544fd3ef24609bff2379f52;hpb=28ef6c316f1aff914bb95ac09787a3c83c1815fd;p=platform%2Fupstream%2Fbash.git diff --git a/flags.c b/flags.c index 8d2f7f5..cdf2aef 100644 --- a/flags.c +++ b/flags.c @@ -28,8 +28,12 @@ Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #include "shell.h" #include "flags.h" +#if defined (BANG_HISTORY) +# include "bashhist.h" +#endif + #if defined (JOB_CONTROL) -extern int set_job_control (); +extern int set_job_control __P((int)); #endif #if defined (RESTRICTED_SHELL) @@ -67,7 +71,7 @@ int place_keywords_in_env = 0; /* Non-zero means read commands, but don't execute them. This is useful for debugging shell scripts that should do something hairy and possibly - desctructive. */ + destructive. */ int read_but_dont_execute = 0; /* Non-zero means end of file is after one command. */ @@ -240,31 +244,36 @@ change_flag (flag, on_or_off) /* Special cases for a few flags. */ switch (flag) { +#if defined (BANG_HISTORY) + case 'H': + if (on_or_off == FLAG_ON) + bash_initialize_history (); + break; +#endif + #if defined (JOB_CONTROL) case 'm': set_job_control (on_or_off == FLAG_ON); break; #endif /* JOB_CONTROL */ -#if defined (RESTRICTED_SHELL) - case 'r': - if (on_or_off == FLAG_ON) - maybe_make_restricted (shell_name); + case 'n': + if (interactive_shell) + read_but_dont_execute = 0; break; -#endif - -#if defined (BANG_HISTORY) - case 'H': - if (on_or_off == FLAG_ON) - bash_initialize_history (); - break; -#endif case 'p': if (on_or_off == FLAG_OFF) disable_priv_mode (); + break; +#if defined (RESTRICTED_SHELL) + case 'r': + if (on_or_off == FLAG_ON) + maybe_make_restricted (shell_name); break; +#endif + } return (old_value); @@ -278,7 +287,7 @@ which_set_flags () char *temp; int i, string_index; - temp = xmalloc (1 + NUM_SHELL_FLAGS + read_from_stdin + want_pending_command); + temp = (char *)xmalloc (1 + NUM_SHELL_FLAGS + read_from_stdin + want_pending_command); for (i = string_index = 0; shell_flags[i].name; i++) if (*(shell_flags[i].value)) temp[string_index++] = shell_flags[i].name;