2 * Copyright (C) 2006 Rich Felker <dalias@aerifal.cx>
4 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
11 int getsubopt(char **opt
, char *const *keys
, char **val
)
17 *opt
= strchr(s
, ',');
18 if (*opt
) *(*opt
)++ = 0;
19 else *opt
= s
+ strlen(s
);
21 for (i
=0; keys
[i
]; i
++) {
22 size_t l
= strlen(keys
[i
]);
23 if (strncmp(keys
[i
], s
, l
)) continue;
26 else if (s
[l
]) continue;