summaryrefslogtreecommitdiff
path: root/expand.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2012-03-04 08:09:09 +0000
committerPaul Smith <psmith@gnu.org>2012-03-04 08:09:09 +0000
commitb02549f7f8acb026c1209e09639c719e736ffd3c (patch)
tree7cf272861f2940b998b41b81ec19778254504887 /expand.c
parent2870835e6906d213056ab6ed447ab4d162870f3a (diff)
downloadmake-b02549f7f8acb026c1209e09639c719e736ffd3c.tar.gz
Ensure appending private variables in pattern-specific target variables.
Fixes Savannah bug #35468.
Diffstat (limited to 'expand.c')
-rw-r--r--expand.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/expand.c b/expand.c
index e9c376c0..9514483b 100644
--- a/expand.c
+++ b/expand.c
@@ -497,6 +497,8 @@ variable_append (const char *name, unsigned int length,
{
const struct variable *v;
char *buf = 0;
+ /* If this set is local and the next is not a parent, then next is local. */
+ int nextlocal = local && set->next_is_parent == 0;
/* If there's nothing left to check, return the empty buffer. */
if (!set)
@@ -507,12 +509,12 @@ variable_append (const char *name, unsigned int length,
/* 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);
+ return variable_append (name, length, set->next, nextlocal);
/* 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, 0);
+ buf = variable_append (name, length, set->next, nextlocal);
else
buf = initialize_variable_output ();