Pass argc pointer to parse_options()

This lets us keep argc up to date as the backend picks out arguments
from the argv array.
This commit is contained in:
Kristian Høgsberg
2013-02-20 15:27:49 -05:00
parent d5a97ae053
commit 4172f668e7
30 changed files with 53 additions and 54 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ struct weston_option {
int
parse_options(const struct weston_option *options,
int count, int argc, char *argv[]);
int count, int *argc, char *argv[]);
#endif /* CONFIGPARSER_H */
+3 -2
View File
@@ -51,11 +51,11 @@ handle_option(const struct weston_option *option, char *value)
int
parse_options(const struct weston_option *options,
int count, int argc, char *argv[])
int count, int *argc, char *argv[])
{
int i, j, k, len = 0;
for (i = 1, j = 1; i < argc; i++) {
for (i = 1, j = 1; i < *argc; i++) {
for (k = 0; k < count; k++) {
if (options[k].name)
len = strlen(options[k].name);
@@ -77,6 +77,7 @@ parse_options(const struct weston_option *options,
argv[j++] = argv[i];
}
argv[j] = NULL;
*argc = j;
return j;
}