diff options
author | Paul Smith <psmith@gnu.org> | 2006-03-15 03:31:30 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2006-03-15 03:31:30 +0000 |
commit | 50eb3cf5e5a8a68b68e966a6607f668f2c36191e (patch) | |
tree | 8665fbf1e101e681967fbfea570d09bbe6f3ab54 /expand.c | |
parent | 6d8d9b74d9c50cb07fe952ac0929f618e4280a55 (diff) | |
download | gunmake-50eb3cf5e5a8a68b68e966a6607f668f2c36191e.tar.gz |
Fix Savannah bug #15913.
Diffstat (limited to 'expand.c')
-rw-r--r-- | expand.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -501,14 +501,19 @@ variable_append (const char *name, unsigned int length, if (buf > variable_buffer) buf = variable_buffer_output (buf, " ", 1); - return variable_buffer_output (buf, v->value, strlen (v->value)); + /* Either expand it or copy it, depending. */ + if (! v->recursive) + return variable_buffer_output (buf, v->value, strlen (v->value)); + + buf = variable_expand_string (buf, v->value, strlen (v->value)); + return (buf + strlen (buf)); } static char * allocated_variable_append (const struct variable *v) { - char *val, *retval; + char *val; /* Construct the appended variable value. */ @@ -524,12 +529,7 @@ allocated_variable_append (const struct variable *v) variable_buffer = obuf; variable_buffer_length = olen; - /* Now expand it and return that. */ - - retval = allocated_variable_expand (val); - - free (val); - return retval; + return val; } /* Like variable_expand_for_file, but the returned string is malloc'd. |