3e48732f250efdd0d7c6d8e998744f3d45737478
[feed/packages.git] / libs / libv4l / patches / 030-getsubopt.patch
1 --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
2 +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
3 @@ -785,15 +785,17 @@ static bool parse_subset(char *optarg)
4
5 static bool parse_next_subopt(char **subs, char **value)
6 {
7 - static char *const subopts[] = {
8 - NULL
9 - };
10 - int opt = getsubopt(subs, subopts, value);
11 + char *p = *subs;
12 + *value = *subs;
13
14 - if (opt < 0 || *value)
15 - return false;
16 - fprintf(stderr, "Missing suboption value\n");
17 - return true;
18 + while (*p && *p != ',')
19 + p++;
20 +
21 + if (*p)
22 + *p++ = '\0';
23 +
24 + *subs = p;
25 + return false;
26 }
27
28 void common_cmd(const std::string &media_bus_info, int ch, char *optarg)