aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
authorRay Kinsella <mdr@ashroe.eu>2021-05-25 15:55:30 +0100
committerBeno�t Ganne <bganne@cisco.com>2021-05-26 07:03:26 +0000
commit3fb978e2618a6c71152b979c391d0c549937efbd (patch)
tree6faa6b9e9fc7a74785c219b1588c34358bb792b7 /src/vlib
parentdbf90d499bb9e36e3bbb57a0b964003e3eb183c5 (diff)
vlib: revert exec cmd handle scripts with blank lines
This reverts commit 269e1569e1f7798bf7d7f539daf505b2f1997a08. Type: fix Change-Id: I40bd71ae3b5e9dc8345fb2460aae437de8a9a5ba Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/unix/cli.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/src/vlib/unix/cli.c b/src/vlib/unix/cli.c
index c8ebb3313b8..7b9a2315910 100644
--- a/src/vlib/unix/cli.c
+++ b/src/vlib/unix/cli.c
@@ -3436,28 +3436,10 @@ unix_cli_exec (vlib_main_t * vm,
vec_free (expanded);
}
- while (1)
+ while (unformat_user (&sub_input, unformat_line_input, line_input))
{
- int rv = unformat_user (&sub_input, unformat_line_input, line_input);
-
- /* No match? */
- if (rv == 0)
- {
- /* Out of input, we're done... */
- if (sub_input.index == UNFORMAT_END_OF_INPUT)
- {
- unformat_free (line_input);
- break;
- }
- /* Blank line... */
- sub_input.index++;
- }
- else
- {
- /* Process the line we just read */
- vlib_cli_input (vm, line_input, 0, 0);
- unformat_free (line_input);
- }
+ vlib_cli_input (vm, line_input, 0, 0);
+ unformat_free (line_input);
}
unformat_free (&sub_input);