[PATCH 1/1] option-parser: mark option value arguments as parsed

Alex DAMIAN alexandru.damian at intel.com
Thu Sep 26 03:15:57 PDT 2013


From: Alexandru DAMIAN <alexandru.damian at intel.com>

Weston options in long name format may have the
values separated from option name by the '=' character,
or specified as a separate argument, e.g.
"--config value".

If the option value is a separate argument, we need
to mark that argument as parsed and not try to
reiterate over it.

Signed-off-by: Alexandru DAMIAN <alexandru.damian at intel.com>
---
 shared/option-parser.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/shared/option-parser.c b/shared/option-parser.c
index c00349a..c8a84db 100644
--- a/shared/option-parser.c
+++ b/shared/option-parser.c
@@ -67,6 +67,7 @@ parse_options(const struct weston_option *options,
 			    strncmp(options[k].name, &argv[i][2], len) == 0 &&
 			    (argv[i][len + 2] == '=' || argv[i][len + 2] == '\0')) {
 				handle_option(&options[k], &argv[i][len + 3]);
+				if (argv[i][len+2] == '\0') i++;
 				break;
 			} else if (options[k].short_name &&
 				   argv[i][0] == '-' &&
-- 
1.8.1.2



More information about the wayland-devel mailing list