Fix config reader regular expression for MUSL.

It was not dealing with multiple spaces between the key and the value
with MUSL correctly. This change ensures that if a value exists, that it
begins and ends with a non-blank character.
This commit is contained in:
Seth Hall 2020-08-04 12:34:04 -04:00
parent dbd8a4fc9f
commit 7f4914c219
3 changed files with 3 additions and 1 deletions

View file

@ -182,7 +182,7 @@ bool Config::DoUpdate()
}
regex_t re;
if ( regcomp(&re, "^([^[:blank:]]+)[[:blank:]]+(.*[^[:blank:]])?[[:blank:]]*$", REG_EXTENDED) )
if ( regcomp(&re, "^([^[:blank:]]+)[[:blank:]]+([^[:blank:]](.*[^[:blank:]])?)?[[:blank:]]*$", REG_EXTENDED) )
{
Error(Fmt("Failed to compile regex."));
return true;