summaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
authormdr78 <mdr@ashroe.eu>2021-03-23 12:40:21 +0000
committerDave Barach <openvpp@barachs.net>2021-04-28 14:58:00 +0000
commitfd4fd0d1853ae7384e7a64c4cad17a3469720b95 (patch)
treed37ca4e49a95844c5cf51fc1609eeedb940aba1a /src/vlib
parent8d58dc40a0a20f0bb3047a7a7ae6d47b6b5879f9 (diff)
pg: exec file fixes
A number of the pg commands were being passed the whole exec file, instead of just a line from the file. Type: fix Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: I2f96e7648b9b7d501088eddff7e4a761973e71f4
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/unix/cli.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/vlib/unix/cli.c b/src/vlib/unix/cli.c
index 6c98867253f..7b9a2315910 100644
--- a/src/vlib/unix/cli.c
+++ b/src/vlib/unix/cli.c
@@ -3352,6 +3352,7 @@ unix_cli_exec (vlib_main_t * vm,
char *file_name;
int fd;
unformat_input_t sub_input;
+ unformat_input_t _line_input, *line_input = &_line_input;
clib_error_t *error;
unix_cli_main_t *cm = &unix_cli_main;
unix_cli_file_t *cf;
@@ -3435,7 +3436,11 @@ unix_cli_exec (vlib_main_t * vm,
vec_free (expanded);
}
- vlib_cli_input (vm, &sub_input, 0, 0);
+ while (unformat_user (&sub_input, unformat_line_input, line_input))
+ {
+ vlib_cli_input (vm, line_input, 0, 0);
+ unformat_free (line_input);
+ }
unformat_free (&sub_input);
done: