Skip to contentSkip to conversation

common/config: Allow sections names to contain hyphen

PATCH In review Nikolay Borisov 2 participants 3 messages Jun 25, 2020 – Aug 30, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 common/config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/config +1 -1
index 8023273da115..63d486125a76 100644
@@ -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
Signature · 1 line
2.17.1
#1 lore raw
Quoted 6 lines · Nikolay Borisov

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.

---

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

Quoted 17 lines
 common/config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/config +1 -1
index 8023273da115..63d486125a76 100644
@@ -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 lore raw
In reply to Nikolay Borisov
Quoted 5 lines · Nikolay Borisov

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.

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

Thanks,
Eryu

Quoted 20 lines
---
 common/config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/config +1 -1
index 8023273da115..63d486125a76 100644
@@ -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
Signature · 1 line
2.17.1