diff mbox series

common/config: Allow sections names to contain hyphen

Message ID 20200625123744.17812-1-nborisov@suse.com (mailing list archive)
State New, archived
Headers show
Series common/config: Allow sections names to contain hyphen | expand

Commit Message

Nikolay Borisov June 25, 2020, 12:37 p.m. UTC
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>
---
 common/config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nikolay Borisov Aug. 26, 2020, 4:04 p.m. UTC | #1
On 25.06.20 г. 15:37 ч., Nikolay Borisov wrote:
> 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>
> ---

This patch seems to have fallen through the cracks so - ping ?

>  common/config | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/config b/common/config
> index 8023273da115..63d486125a76 100644
> --- a/common/config
> +++ b/common/config
> @@ -449,7 +449,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
>
Eryu Guan Aug. 30, 2020, 4:25 p.m. UTC | #2
On Thu, Jun 25, 2020 at 03:37:44PM +0300, Nikolay Borisov wrote:
> 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>

Sorry, this patch fell off my radar.. Applied!

Thanks,
Eryu

> ---
>  common/config | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/config b/common/config
> index 8023273da115..63d486125a76 100644
> --- a/common/config
> +++ b/common/config
> @@ -449,7 +449,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
> -- 
> 2.17.1
>
diff mbox series

Patch

diff --git a/common/config b/common/config
index 8023273da115..63d486125a76 100644
--- a/common/config
+++ b/common/config
@@ -449,7 +449,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