}
}
+static inline int iskeychar(int c)
+{
+ return isalnum(c) || c == '-';
+}
+
static int get_value(config_fn_t fn, char *name, unsigned int len)
{
int c;
c = get_next_char();
if (c == EOF)
break;
- if (!isalnum(c))
+ if (!iskeychar(c))
break;
name[len++] = tolower(c);
if (len >= MAXNAME)
return baselen;
if (isspace(c))
return get_extended_base_var(name, baselen, c);
- if (!isalnum(c) && c != '.')
+ if (!iskeychar(c) && c != '.')
return -1;
if (baselen > MAXNAME / 2)
return -1;
dot = 1;
/* Leave the extended basename untouched.. */
if (!dot || i > store.baselen) {
- if (!isalnum(c) || (i == store.baselen+1 && !isalpha(c))) {
+ if (!iskeychar(c) || (i == store.baselen+1 && !isalpha(c))) {
fprintf(stderr, "invalid key: %s\n", key);
free(store.key);
ret = 1;