[PATCH BlueZ] shared/shell: Fix short option parsing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.13.6

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux