+1998-06-17 Mark Mitchell <mark@markmitchell.com>
+
+ * errfn.c (cp_thing): Handle the `%%' formatting sequence.
+
1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
* method.c (hack_identifier): Complain about getting a namespace
#define STRDUP(f) (ap = (char *) alloca (strlen (f) +1), strcpy (ap, (f)), ap)
-/* This function supports only `%s', `%d', and the C++ print codes. */
+/* This function supports only `%s', `%d', `%%', and the C++ print
+ codes. */
#ifdef __STDC__
static void
strcpy (buf + offset, p);
offset += plen;
}
+ else if (*f == '%')
+ {
+ /* A `%%' has occurred in the input string. Since the
+ string we produce here will be passed to vprintf we must
+ preserve both `%' characters. */
+
+ len += 2;
+ if (len > buflen)
+ {
+ buflen = len;
+ buf = xrealloc (buf, len);
+ }
+ strcpy (buf + offset, "%%");
+ offset += 2;
+ }
else
{
if (*f != 'd')