From 302a03f1c25680e3309f236c4cb60106b102529c Mon Sep 17 00:00:00 2001 From: Inga Stotland Date: Wed, 21 Mar 2018 20:13:00 -0700 Subject: [PATCH] shared/shell: Fix short option parsing The index value used for detecting and validating a short option was not reset after processing a first short option. This prevented the correct parsing of additional short options. Fixed by resetting the index value back to original after each iteration. --- src/shared/shell.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shared/shell.c b/src/shared/shell.c index 9cd8d2567..10f26264f 100644 --- a/src/shared/shell.c +++ b/src/shared/shell.c @@ -957,6 +957,8 @@ void bt_shell_init(int argc, char **argv, const struct bt_shell_opt *opt) *opt->optarg[index - offset] = optarg; } + + index = -1; } data.argc = argc - optind; -- 2.47.3