diff options
Diffstat (limited to 'bounce.h')
-rw-r--r-- | bounce.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bounce.h b/bounce.h index 5aff027..1eb5ce9 100644 --- a/bounce.h +++ b/bounce.h @@ -102,19 +102,20 @@ static const char *CapNames[] = { #undef X }; -static inline enum Cap capParse(const char *list) { +static inline enum Cap capParse(const char *list, const char *values[CapBits]) { enum Cap caps = 0; while (*list) { enum Cap cap = CapUnsupported; - size_t len = strcspn(list, " "); + size_t len = strcspn(list, "= "); for (size_t i = 0; i < ARRAY_LEN(CapNames); ++i) { if (len != strlen(CapNames[i])) continue; if (strncmp(list, CapNames[i], len)) continue; cap = 1 << i; + if (list[len] == '=' && values) values[i] = &list[len + 1]; break; } caps |= cap; - list += len; + list += strcspn(list, " "); if (*list) list++; } return caps; |