+2006-03-14 Paul D. Smith <psmith@gnu.org>
+
+ * expand.c (variable_append): Instead of appending everything then
+ expanding the result, we expand (or not, if it's simple) each part
+ as we add it.
+ (allocated_variable_append): Don't expand the final result.
+ Fixes Savannah bug #15913.
+
2006-03-09 Paul Smith <psmith@gnu.org>
* remake.c (update_file_1): Revert the change of 3 Jan 2006 which
in the next release, to give them time to fix their build system.
Fixes Savannah bug #16002.
Introduces Savannah bug #16051.
-
+
* implicit.c (pattern_search) [DOS_PATHS]: Look for DOS paths if
we *don't* find UNIX "/".
Reported by David Ergo <david.ergo@alterface.com>
the build_w32.bat batch file; see the file README.W32 for more
details.
+* WARNING: Future backward-incompatibility!
+ Up to and including this release, the '$?' variable does not contain
+ any prerequisite that does not exist, even though that prerequisite
+ might have caused the target to rebuild. Starting with the _next_
+ release of GNU make, '$?' will contain all prerequisites that caused
+ the target to be considered out of date. See this Savannah bug:
+ http://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=16051
+
* WARNING: Backward-incompatibility!
GNU make now implements a generic "second expansion" feature on the
prerequisites of both explicit and implicit (pattern) rules. In order
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. */
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.
rmfiles('t1/rules.mk');
rmdir('t1');
+# TEST #18
+
+# Test appending to a simple variable containing a "$": avoid a
+# double-expansion. See Savannah bug #15913.
+
+run_make_test("
+VAR := \$\$FOO
+foo: VAR += BAR
+foo: ; \@echo '\$(VAR)'",
+ '',
+ '$FOO BAR');
+
1;