Support both " and ' as string delimiters when parsing the command line
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Thu, 22 Aug 2013 16:20:59 +0000 (18:20 +0200)
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Thu, 22 Aug 2013 16:21:47 +0000 (18:21 +0200)
Entity names are enclosed in quotes. Support both double-quoted and
single-quoted strings.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
src/mediactl.c

index c854357..b22fbdf 100644 (file)
@@ -541,9 +541,9 @@ struct media_pad *media_parse_pad(struct media_device *media,
 
        for (; isspace(*p); ++p);
 
-       if (*p == '"') {
-               for (end = (char *)p + 1; *end && *end != '"'; ++end);
-               if (*end != '"') {
+       if (*p == '"' || *p == '\'') {
+               for (end = (char *)p + 1; *end && *end != '"' && *end != '\''; ++end);
+               if (*end != '"' && *end != '\'') {
                        media_dbg(media, "missing matching '\"'\n");
                        *endp = end;
                        return NULL;