#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)
/* 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. */
/* 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);
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;