2011-05-07 Paul Smith <psmith@gnu.org>
+ * expand.c (variable_append): Add a LOCAL argument to track
+ whether this is the first invocation or not. If it's not and
+ private_var is set, then skip this variable and try the next one.
+ Fixes Savannah bug #32872.
+
* read.c (parse_file_seq): Ensure existence checks use glob().
2011-05-07 Eli Zaretskii <eliz@gnu.org>
static char *
variable_append (const char *name, unsigned int length,
- const struct variable_set_list *set)
+ const struct variable_set_list *set, int local)
{
const struct variable *v;
char *buf = 0;
/* Try to find the variable in this variable set. */
v = lookup_variable_in_set (name, length, set->set);
- /* If there isn't one, look to see if there's one in a set above us. */
- if (!v)
- return variable_append (name, length, set->next);
+ /* If there isn't one, or this one is private, try the set above us. */
+ if (!v || (!local && v->private_var))
+ return variable_append (name, length, set->next, 0);
/* If this variable type is append, first get any upper values.
If not, initialize the buffer. */
if (v->append)
- buf = variable_append (name, length, set->next);
+ buf = variable_append (name, length, set->next, 0);
else
buf = initialize_variable_output ();
variable_buffer = 0;
- val = variable_append (v->name, strlen (v->name), current_variable_set_list);
+ val = variable_append (v->name, strlen (v->name),
+ current_variable_set_list, 1);
variable_buffer_output (val, "", 1);
val = variable_buffer;