mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-15 07:38:43 +00:00
CLI: Dropped the lexer hack.
This commit is contained in:
parent
f93315c417
commit
02297d3c54
@ -262,6 +262,7 @@ else: {
|
|||||||
|
|
||||||
<CLI>(.|\n) {
|
<CLI>(.|\n) {
|
||||||
BEGIN(INITIAL);
|
BEGIN(INITIAL);
|
||||||
|
yyless(0);
|
||||||
return CLI_MARKER;
|
return CLI_MARKER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
13
nest/cli.c
13
nest/cli.c
@ -244,7 +244,6 @@ struct cli_conf_order {
|
|||||||
struct cli *cli;
|
struct cli *cli;
|
||||||
const char *pos;
|
const char *pos;
|
||||||
uint len;
|
uint len;
|
||||||
int lexer_hack;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
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;
|
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)
|
if (max > cco->len)
|
||||||
max = cco->len;
|
max = cco->len;
|
||||||
|
|
||||||
@ -298,7 +286,6 @@ cli_command(struct cli *c)
|
|||||||
.lp = c->parser_pool,
|
.lp = c->parser_pool,
|
||||||
.pool = c->pool,
|
.pool = c->pool,
|
||||||
},
|
},
|
||||||
.lexer_hack = 1,
|
|
||||||
.pos = c->rx_buf,
|
.pos = c->rx_buf,
|
||||||
.len = strlen(c->rx_buf),
|
.len = strlen(c->rx_buf),
|
||||||
.cli = c,
|
.cli = c,
|
||||||
|
Loading…
Reference in New Issue
Block a user