From: Lukas Czerner Date: Fri, 11 Apr 2014 00:09:48 +0000 (+1000) Subject: config: fix specifying configuration value with equality sign X-Git-Tag: v2022.05.01~3184 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5138e74a2e81b0df5aab6e7688e3692e5140ac21;p=xfstests-dev.git config: fix specifying configuration value with equality sign Currently there is a problem with parse_config_section() when the configuration value contains equality sign like this for example: MOUNT_OPTIONS="-o data=journal" the result will be export MOUNT_OPTIONS="-o data="journal" which is not going to work. The reason is that the expression used to parse the configuration options uses greedy matching '.*'. Fix this by using non greedy expression to match the first equality sign '[^=]'. Signed-off-by: Lukas Czerner Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- diff --git a/common/config b/common/config index 00249e6a..49f34cf4 100644 --- a/common/config +++ b/common/config @@ -349,7 +349,7 @@ parse_config_section() { -e 's/#.*$//' \ -e 's/[[:space:]]*$//' \ -e 's/^[[:space:]]*//' \ - -e "s/^\(.*\)=\"\?'\?\([^\"']*\)\"\?'\?$/export \1=\"\2\"/" \ + -e "s/^\([^=]*\)=\"\?'\?\([^\"']*\)\"\?'\?$/export \1=\"\2\"/" \ < $HOST_OPTIONS \ | sed -n -e "/^\[$SECTION\]/,/^\s*\[/{/^[^#].*\=.*/p;}"` }