common/config: Allow sections names to contain hyphen
authorNikolay Borisov <nborisov@suse.com>
Thu, 25 Jun 2020 12:37:44 +0000 (15:37 +0300)
committerEryu Guan <guaneryu@gmail.com>
Sun, 30 Aug 2020 16:23:52 +0000 (00:23 +0800)
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>
common/config

index e356bcda7e7057dfea21da5d8c93021e55d4fcab..1fe1e0e18867d8416e9b531afabebfd6c24ade7e 100644 (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