diff options
author | Damjan Marion <damarion@cisco.com> | 2022-05-14 00:24:34 +0200 |
---|---|---|
committer | Damjan Marion <damarion@cisco.com> | 2022-05-14 00:30:42 +0200 |
commit | 342044a3b5a8b2fe6287ca49b69df0c4bd2ca34c (patch) | |
tree | 2dcfab26fddd35b7a98d4199b00f9fc897744bfe /src/vlib | |
parent | c50bcbd6c28f2fd87f87b86bd5b215892daf46a6 (diff) |
session: revert "fix session cli maybe parse wrong args if executed in files"
Fixed at infra level.
Type: improvement
Change-Id: I43cf16870c1d2e12189073f7786d62375c46e2c2
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib')
-rw-r--r-- | src/vlib/cli.c | 40 | ||||
-rw-r--r-- | src/vlib/cli.h | 1 |
2 files changed, 0 insertions, 41 deletions
diff --git a/src/vlib/cli.c b/src/vlib/cli.c index 80da2d59992..c43371e0d9f 100644 --- a/src/vlib/cli.c +++ b/src/vlib/cli.c @@ -159,46 +159,6 @@ done: return match; } -/* Get current command args */ -uword -unformat_vlib_cli_args (unformat_input_t *i, va_list *va) -{ - unformat_input_t *result = va_arg (*va, unformat_input_t *); - u8 *line; - uword last_c; - u32 index = i->index; - - if (unformat_is_eof (i)) - { - unformat_init (result, 0, 0); - return 0; - } - - /* try to find last non-space character */ - do - { - ASSERT (index > 0); - last_c = i->buffer[--index]; - } - while (last_c == ' '); - - if (last_c == '\t' || last_c == '\n' || last_c == '\r' || last_c == '\f' || - last_c == '}') - { - /* current command has no args */ - unformat_init (result, 0, 0); - return 0; - } - - if (!unformat_user (i, unformat_line, &line)) - { - unformat_init (result, 0, 0); - return 0; - } - unformat_init_vector (result, line); - return 1; -} - uword unformat_vlib_cli_line (unformat_input_t *i, va_list *va) { diff --git a/src/vlib/cli.h b/src/vlib/cli.h index 86913e9708c..a2f9c24d2ec 100644 --- a/src/vlib/cli.h +++ b/src/vlib/cli.h @@ -204,7 +204,6 @@ clib_error_t *vlib_cli_register (struct vlib_main_t *vm, clib_error_t *vlib_cli_register_parse_rule (struct vlib_main_t *vm, vlib_cli_parse_rule_t * c); -uword unformat_vlib_cli_args (unformat_input_t *i, va_list *va); unformat_function_t unformat_vlib_cli_line; uword unformat_vlib_cli_sub_input (unformat_input_t * i, va_list * args); |