From 6fa76a7d153a9ec19d0f19dd19f6d456e044fcbe Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 22 Aug 1999 17:50:57 +0000 Subject: * Various changes. --- variable.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'variable.c') diff --git a/variable.c b/variable.c index d07b5e1..97207f1 100644 --- a/variable.c +++ b/variable.c @@ -780,9 +780,9 @@ try_variable_definition (flocp, line, origin) case f_simple: /* A simple variable definition "var := value". Expand the value. We have to allocate memory since otherwise it'll clobber the - variable buffer, and we still need that. */ - alloc_value = allocated_variable_expand (p); - value = alloc_value; + variable buffer, and we may still need that if we're looking at a + target-specific variable. */ + value = alloc_value = allocated_variable_expand (p); break; case f_conditional: /* A conditional variable definition "var ?= value". @@ -824,8 +824,10 @@ try_variable_definition (flocp, line, origin) else /* The previous definition of the variable was simple. The new value comes from the old value, which was expanded - when it was set; and from the expanded new value. */ - p = variable_expand (p); + when it was set; and from the expanded new value. Allocate + memory for the expansion as we may still need the rest of the + buffer if we're looking at a target-specific variable. */ + p = alloc_value = allocated_variable_expand (p); oldlen = strlen (v->value); newlen = strlen (p); -- cgit v1.2.3