packages/libs/libv4l/patches/030-dont-call-getsubopt.patch
Ted Hess 4c73560932 libv4l: Update version to 1.10.0. Fix musl/uClibc incompatibility with getsubopt()
Signed-off-by: Ted Hess <thess@kitschensync.net>
2016-02-27 09:49:17 -05:00

28 lines
620 B
Diff

--- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
@@ -671,15 +671,18 @@ static bool parse_subset(char *optarg)
static bool parse_next_subopt(char **subs, char **value)
{
- static char *const subopts[] = {
- NULL
- };
- int opt = getsubopt(subs, subopts, value);
+ char *stmp = *subs;
+ *value = NULL;
- if (opt < 0 || *value)
+ if (*subs) {
+ *subs = strchr(stmp, ',');
+ if (*subs)
+ *(*subs)++ = 0;
+ else *subs = stmp + strlen(stmp);
+
+ *value = stmp;
return false;
- fprintf(stderr, "No value given to suboption <%s>\n",
- subopts[opt]);
+ }
return true;
}