diff --git a/src/ucl_parser.c b/src/ucl_parser.c index d6ea46e..b7c8b9f 100644 --- a/src/ucl_parser.c +++ b/src/ucl_parser.c @@ -567,15 +567,13 @@ ucl_parse_key (struct ucl_parser *parser, else { /* Parse the body of a key */ if (!got_quote) { - if (isalnum (*p)) { - ucl_chunk_skipc (chunk, *p); - p ++; - } - else if (*p == ' ' || *p == '\t' || *p == ':' || *p == '=') { + if (*p == ' ' || *p == '\t' || *p == ':' || *p == '=') { end = p; break; - } - else { + } else if (iswprint (*p)) { + ucl_chunk_skipc (chunk, *p); + p ++; + } else { ucl_set_err (chunk, UCL_ESYNTAX, "invalid character in a key", err); return false; }