030-dont-call-getsubopt.patch (620B)
1 --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp 2 +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp 3 @@ -671,15 +671,18 @@ 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 *stmp = *subs; 12 + *value = NULL; 13 14 - if (opt < 0 || *value) 15 + if (*subs) { 16 + *subs = strchr(stmp, ','); 17 + if (*subs) 18 + *(*subs)++ = 0; 19 + else *subs = stmp + strlen(stmp); 20 + 21 + *value = stmp; 22 return false; 23 - fprintf(stderr, "No value given to suboption <%s>\n", 24 - subopts[opt]); 25 + } 26 return true; 27 } 28