summaryrefslogtreecommitdiff
path: root/conf/cf-lex.l
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1998-12-06 23:10:28 +0000
committerMartin Mares <mj@ucw.cz>1998-12-06 23:10:28 +0000
commitcc12cf05c789ef85d72cf19e9b52f0c4982542f7 (patch)
tree2e0823e050ba57446c4398862ed905dc55b21e6f /conf/cf-lex.l
parenta1bf6440b5c27f7fb829eb25f6ac1c2629eb72eb (diff)
cf_error() now accepts any format strings instead of just an error
message. Also added extra kludge to get rid of collisions of REJECT symbols.
Diffstat (limited to 'conf/cf-lex.l')
-rw-r--r--conf/cf-lex.l15
1 files changed, 13 insertions, 2 deletions
diff --git a/conf/cf-lex.l b/conf/cf-lex.l
index f608a3d3..9e6b120f 100644
--- a/conf/cf-lex.l
+++ b/conf/cf-lex.l
@@ -7,12 +7,15 @@
*/
%{
+#undef REJECT /* Avoid name clashes */
#include <errno.h>
#include <stdlib.h>
#include <string.h>
+#include <stdarg.h>
#include "nest/bird.h"
+#include "lib/string.h"
#include "conf/conf.h"
#include "conf/cf-parse.tab.h"
@@ -221,9 +224,16 @@ cf_lex_init_tables(void)
}
void
-cf_error(char *msg)
+cf_error(char *msg, ...)
{
- die(PATH_CONFIG ", line %d: %s", cf_lino, msg);
+ /* FIXME */
+
+ char buf[1024];
+ va_list args;
+
+ va_start(args, msg);
+ bvsprintf(buf, msg, args);
+ die(PATH_CONFIG ", line %d: %s", cf_lino, buf);
}
void
@@ -243,3 +253,4 @@ cfg_strdup(char *c)
memcpy(z, c, l);
return z;
}
+