aboutsummaryrefslogtreecommitdiffstats
path: root/flags.c
diff options
context:
space:
mode:
authorJari Aalto <jari.aalto@cante.net>2001-11-13 17:56:06 +0000
committerJari Aalto <jari.aalto@cante.net>2009-09-12 16:46:54 +0000
commitf73dda092b33638d2d5e9c35375f687a607b5403 (patch)
treef21584e70a444d6a1ecba0fb5e2cf79e8cce91db /flags.c
parent28ef6c316f1aff914bb95ac09787a3c83c1815fd (diff)
downloadandroid_external_bash-f73dda092b33638d2d5e9c35375f687a607b5403.tar.gz
android_external_bash-f73dda092b33638d2d5e9c35375f687a607b5403.tar.bz2
android_external_bash-f73dda092b33638d2d5e9c35375f687a607b5403.zip
Imported from ../bash-2.05a.tar.gz.
Diffstat (limited to 'flags.c')
-rw-r--r--flags.c39
1 files changed, 24 insertions, 15 deletions
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;