mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-11 04:30:44 +02:00
commit bash-20190612 snapshot
This commit is contained in:
+17
-1
@@ -1,6 +1,6 @@
|
||||
/* variables.c -- Functions for hacking shell variables. */
|
||||
|
||||
/* Copyright (C) 1987-2018 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1987-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -229,6 +229,10 @@ static SHELL_VAR *get_epochrealtime __P((SHELL_VAR *));
|
||||
|
||||
static SHELL_VAR *get_bashpid __P((SHELL_VAR *));
|
||||
|
||||
static SHELL_VAR *get_bash_argv0 __P((SHELL_VAR *));
|
||||
static SHELL_VAR *assign_bash_argv0 __P((SHELL_VAR *, char *, arrayind_t, char *));
|
||||
static void set_argv0 __P((void));
|
||||
|
||||
#if defined (HISTORY)
|
||||
static SHELL_VAR *get_histcmd __P((SHELL_VAR *));
|
||||
#endif
|
||||
@@ -554,6 +558,8 @@ initialize_shell_variables (env, privmode)
|
||||
|
||||
set_ppid ();
|
||||
|
||||
set_argv0 ();
|
||||
|
||||
/* Initialize the `getopts' stuff. */
|
||||
temp_var = bind_variable ("OPTIND", "1", 0);
|
||||
VSETATTR (temp_var, att_integer);
|
||||
@@ -1695,6 +1701,16 @@ assign_bash_argv0 (var, value, unused, key)
|
||||
shell_name = static_shell_name;
|
||||
return var;
|
||||
}
|
||||
|
||||
static void
|
||||
set_argv0 ()
|
||||
{
|
||||
SHELL_VAR *v;
|
||||
|
||||
v = find_variable ("BASH_ARGV0");
|
||||
if (v && imported_p (v))
|
||||
assign_bash_argv0 (v, value_cell (v), 0, 0);
|
||||
}
|
||||
|
||||
static SHELL_VAR *
|
||||
get_bash_command (var)
|
||||
|
||||
Reference in New Issue
Block a user