common/config: Allow sections names to contain hyphen

Current regular expression in get_config_sections allows section names
to consist of alphanumeric character and underscore. Extend it to
also allow the hyphen '-' character.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
Nikolay Borisov
2020-06-25 15:37:44 +03:00
committed by Eryu Guan
parent 25824c2703
commit b9d1dcd135
+1 -1
View File
@@ -451,7 +451,7 @@ known_hosts()
# in the section name otherwise the section will not be resognised.
# Section name must be contained between square brackets.
get_config_sections() {
sed -n -e "s/^\[\([[:alnum:]_]*\)\]/\1/p" < $1
sed -n -e "s/^\[\([[:alnum:]_-]*\)\]/\1/p" < $1
}
if [ ! -f "$HOST_OPTIONS" ]; then