int posixly_correct = 0; /* Non-zero means posix.2 superset. */
#endif
-
/* Some long-winded argument names. These are obviously new. */
#define Int 1
#define Charp 2
char **subshell_argv;
char **subshell_envp;
+char *exec_argv0;
+
#if defined (BUFFERED_INPUT)
/* The file descriptor from which the shell is reading input. */
int default_buffered_input = -1;
}
free (dollar_vars[0]);
- dollar_vars[0] = savestring (script_name);
+ dollar_vars[0] = exec_argv0 ? savestring (exec_argv0) : savestring (script_name);
+ if (exec_argv0)
+ {
+ free (exec_argv0);
+ exec_argv0 = (char *)NULL;
+ }
#if defined (ARRAY_VARS)
GET_ARRAY_FROM_VAR ("FUNCNAME", funcname_v, funcname_a);
initialize_flags ();
/* Initialize the shell options. Don't import the shell options
- from the environment variable $SHELLOPTS if we are running in
- privileged or restricted mode or if the shell is running setuid. */
+ from the environment variables $SHELLOPTS or $BASHOPTS if we are
+ running in privileged or restricted mode or if the shell is running
+ setuid. */
#if defined (RESTRICTED_SHELL)
initialize_shell_options (privileged_mode||restricted||running_setuid);
initialize_bashopts (privileged_mode||restricted||running_setuid);