mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-05 03:10:50 +02:00
commit bash-20141031 snapshot
This commit is contained in:
+9
-5
@@ -357,6 +357,7 @@ initialize_shell_variables (env, privmode)
|
||||
|
||||
temp_var = (SHELL_VAR *)NULL;
|
||||
|
||||
#if defined (FUNCTION_IMPORT)
|
||||
/* If exported function, define it now. Don't import functions from
|
||||
the environment in privileged mode. */
|
||||
if (privmode == 0 && read_but_dont_execute == 0 &&
|
||||
@@ -406,6 +407,7 @@ initialize_shell_variables (env, privmode)
|
||||
/* Restore original suffix */
|
||||
tname[namelen] = BASHFUNC_SUFFIX[0];
|
||||
}
|
||||
#endif /* FUNCTION_IMPORT */
|
||||
#if defined (ARRAY_VARS)
|
||||
# if ARRAY_EXPORT
|
||||
/* Array variables may not yet be exported. */
|
||||
@@ -420,11 +422,7 @@ initialize_shell_variables (env, privmode)
|
||||
}
|
||||
# endif /* ARRAY_EXPORT */
|
||||
#endif
|
||||
#if 0
|
||||
else if (legal_identifier (name))
|
||||
#else
|
||||
else
|
||||
#endif
|
||||
{
|
||||
ro = 0;
|
||||
if (posixly_correct && STREQ (name, "SHELLOPTS"))
|
||||
@@ -5158,10 +5156,16 @@ void
|
||||
sv_optind (name)
|
||||
char *name;
|
||||
{
|
||||
SHELL_VAR *var;
|
||||
char *tt;
|
||||
int s;
|
||||
|
||||
tt = get_string_value ("OPTIND");
|
||||
var = find_variable ("OPTIND");
|
||||
tt = var ? get_variable_value (var) : (char *)NULL;
|
||||
|
||||
/* Assume that if var->context < variable_context and variable_context > 0
|
||||
then we are restoring the variables's previous state while returning
|
||||
from a function. */
|
||||
if (tt && *tt)
|
||||
{
|
||||
s = atoi (tt);
|
||||
|
||||
Reference in New Issue
Block a user