The implementation in d-lang.cc was based on what was present in libcpp.
This synchronizes the escaping logic to match the current version.
gcc/d/ChangeLog:
* d-lang.cc (deps_add_target): Handle quoting ':' character.
Reimplement backslash tracking.
}
/* Quote characters in target which are significant to Make. */
+ unsigned slashes = 0;
+
for (const char *p = target; *p != '\0'; p++)
{
switch (*p)
{
+ case '\\':
+ slashes++;
+ break;
+
case ' ':
case '\t':
- for (const char *q = p - 1; target <= q && *q == '\\'; q--)
+ while (slashes--)
obstack_1grow (&buffer, '\\');
obstack_1grow (&buffer, '\\');
- break;
+ goto Ldef;
case '$':
obstack_1grow (&buffer, '$');
- break;
+ goto Ldef;
case '#':
+ case ':':
obstack_1grow (&buffer, '\\');
- break;
+ goto Ldef;
default:
+ Ldef:
+ slashes = 0;
break;
}