From 02297d3c548a03940eee935f964181eb926170c5 Mon Sep 17 00:00:00 2001 From: Jan Maria Matejka Date: Thu, 23 Aug 2018 20:44:04 +0200 Subject: [PATCH] CLI: Dropped the lexer hack. --- conf/cf-lex.l | 1 + nest/cli.c | 13 ------------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/conf/cf-lex.l b/conf/cf-lex.l index 1a587dce..72acd947 100644 --- a/conf/cf-lex.l +++ b/conf/cf-lex.l @@ -262,6 +262,7 @@ else: { (.|\n) { BEGIN(INITIAL); + yyless(0); return CLI_MARKER; } diff --git a/nest/cli.c b/nest/cli.c index 9d0e4f30..80946d41 100644 --- a/nest/cli.c +++ b/nest/cli.c @@ -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,