mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-23 13:57:58 +02:00
commit bash-20130419 snapshot
This commit is contained in:
@@ -4902,3 +4902,17 @@ variables.c
|
||||
arrayfunc.c
|
||||
- array_variable_part: return variable even if invisible flag set,
|
||||
callers must handle invisible vars
|
||||
|
||||
4/18
|
||||
----
|
||||
builtins/set.def
|
||||
- unset_builtin: if -n flag given, call unset_nameref instead of
|
||||
unset_variable
|
||||
|
||||
variables.c
|
||||
- find_variable_nameref: print warning message if nameref circular
|
||||
reference detected, return NULL and let caller deal with it
|
||||
|
||||
builtins/declare.def
|
||||
- declare_builtin: only disallow global references at this point if
|
||||
we are at the global scope
|
||||
|
||||
@@ -315,7 +315,8 @@ declare_internal (list, local_var)
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (STREQ (name, value))
|
||||
/* disallow self references at global scope */
|
||||
if (STREQ (name, value) && variable_context == 0)
|
||||
{
|
||||
builtin_error (_("%s: nameref variable self references not allowed"), name);
|
||||
assign_error++;
|
||||
|
||||
+1
-1
@@ -863,7 +863,7 @@ unset_builtin (list)
|
||||
}
|
||||
else
|
||||
#endif /* ARRAY_VARS */
|
||||
tem = unset_function ? unbind_func (name) : unbind_variable (name);
|
||||
tem = unset_function ? unbind_func (name) : (nameref ? unbind_nameref (name) : unbind_variable (name));
|
||||
|
||||
/* This is what Posix.2 says: ``If neither -f nor -v
|
||||
is specified, the name refers to a variable; if a variable by
|
||||
|
||||
+3
-2
@@ -3143,8 +3143,9 @@ The
|
||||
.I expression
|
||||
is treated as if it were within double quotes, but a double quote
|
||||
inside the parentheses is not treated specially.
|
||||
All tokens in the expression undergo parameter expansion, string
|
||||
expansion, command substitution, and quote removal.
|
||||
All tokens in the expression undergo parameter and variable expansion,
|
||||
command substitution, and quote removal.
|
||||
The result is treated as the arithmetic expression to be evaluated.
|
||||
Arithmetic expansions may be nested.
|
||||
.PP
|
||||
The evaluation is performed according to the rules listed below under
|
||||
|
||||
+3
-2
@@ -2216,8 +2216,9 @@ $(( @var{expression} ))
|
||||
|
||||
The expression is treated as if it were within double quotes, but
|
||||
a double quote inside the parentheses is not treated specially.
|
||||
All tokens in the expression undergo parameter expansion, command
|
||||
substitution, and quote removal.
|
||||
All tokens in the expression undergo parameter and variable expansion,
|
||||
command substitution, and quote removal.
|
||||
The result is treated as the arithmetic expression to be evaluated.
|
||||
Arithmetic expansions may be nested.
|
||||
|
||||
The evaluation is performed according to the rules listed below
|
||||
|
||||
@@ -94,11 +94,7 @@
|
||||
/* Maximum amount of recursion allowed. This prevents a non-integer
|
||||
variable such as "num=num+2" from infinitely adding to itself when
|
||||
"let num=num+2" is given. */
|
||||
#if 0
|
||||
#define MAX_EXPR_RECURSION_LEVEL 1024
|
||||
#else
|
||||
#define MAX_EXPR_RECURSION_LEVEL 16
|
||||
#endif
|
||||
|
||||
/* The Tokens. Singing "The Lion Sleeps Tonight". */
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
BUILD_DIR=/usr/local/build/bash/bash-current
|
||||
BUILD_DIR=/usr/local/build/chet/bash/bash-current
|
||||
THIS_SH=$BUILD_DIR/bash
|
||||
PATH=$PATH:$BUILD_DIR
|
||||
|
||||
|
||||
+9
-1
@@ -1846,17 +1846,25 @@ find_variable_nameref (v)
|
||||
{
|
||||
int level;
|
||||
char *newname;
|
||||
SHELL_VAR *orig, *oldv;
|
||||
|
||||
level = 0;
|
||||
orig = v;
|
||||
while (v && nameref_p (v))
|
||||
{
|
||||
level++;
|
||||
if (level > NAMEREF_MAX)
|
||||
return ((SHELL_VAR *)0); /* error message here? */
|
||||
return ((SHELL_VAR *)0); /* error message here? */
|
||||
newname = nameref_cell (v);
|
||||
if (newname == 0 || *newname == '\0')
|
||||
return ((SHELL_VAR *)0);
|
||||
oldv = v;
|
||||
v = find_variable_internal (newname, (expanding_redir == 0 && (assigning_in_environment || executing_builtin)));
|
||||
if (v == orig || v == oldv)
|
||||
{
|
||||
internal_warning (_("%s: circular name reference"), orig->name);
|
||||
return ((SHELL_VAR *)0);
|
||||
}
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user