]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
CLI: Dropped the lexer hack.
authorJan Maria Matejka <mq@ucw.cz>
Thu, 23 Aug 2018 18:44:04 +0000 (20:44 +0200)
committerJan Maria Matejka <mq@ucw.cz>
Fri, 14 Sep 2018 12:44:45 +0000 (14:44 +0200)
conf/cf-lex.l
nest/cli.c

index 1a587dcef52e0490787795109248d85790672744..72acd9476dabed7edd8f6b6a307cfdcb031df60e 100644 (file)
@@ -262,6 +262,7 @@ else: {
 
 <CLI>(.|\n) {
   BEGIN(INITIAL);
+  yyless(0);
   return CLI_MARKER;
 }
 
index 9d0e4f30340da3911726423d7f9cd11b4a64ea8f..80946d4181c0feacf320fb6f3e3ae11a788eb72f 100644 (file)
@@ -244,7 +244,6 @@ struct cli_conf_order {
   struct cli *cli;
   const char *pos;
   uint len;
-  int lexer_hack;
 };
 
 static int
@@ -252,17 +251,6 @@ cli_cmd_read_hook(struct conf_order *co, byte *buf, uint max)
 {
   struct cli_conf_order *cco = (struct cli_conf_order *) co;
 
-  if (cco->lexer_hack)
-    {
-      /* Lexer needs at least one character to be read
-       * to transition between states. Feeding a dummy
-       * character which is dropped to make Flex produce
-       * a dummy "CLIENT" token */
-      cco->lexer_hack = 0;
-      buf[0] = '"';
-      return 1;
-    }
-
   if (max > cco->len)
     max = cco->len;
 
@@ -298,7 +286,6 @@ cli_command(struct cli *c)
       .lp = c->parser_pool,
       .pool = c->pool,
     },
-    .lexer_hack = 1,
     .pos = c->rx_buf,
     .len = strlen(c->rx_buf),
     .cli = c,