--- l2_spec.c 2001/12/22 22:04:18 1.6
+++ l2_spec.c 2001/12/22 22:18:34 1.7
@@ -98,6 +98,7 @@
/* remember a specification parsing error (used internally) */
void l2_spec_error(l2_spec_ctx_t *ctx, l2_result_t rv, YYLTYPE *loc, const char *fmt, ...)
{
+ va_list ap;
const char *cpF, *cpL;
const char *cpP, *cpE;
int line, column;
@@ -143,8 +144,16 @@
*cp++ = '\0';
/* remember error */
- l2_env_errorinfo(ctx->env, rv, "line %d, column %d: `%s'; %s",
- line, column, cpBuf, fmt);
+ va_start(ap, fmt);
+ if ((cp = l2_util_vasprintf(fmt, ap)) != NULL) {
+ l2_env_errorinfo(ctx->env, rv, "line %d, column %d: `%s'; %s",
+ line, column, cpBuf, cp);
+ free(cp);
+ }
+ else
+ l2_env_errorinfo(ctx->env, rv, "line %d, column %d: `%s'; N.A.",
+ line, column, cpBuf);
+ va_end(ap);
ctx->rv = rv;
/* cleanup */
|