mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
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 <lczerner@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
committed by
Dave Chinner
parent
9f1a8e7da7
commit
5138e74a2e
+1
-1
@@ -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;}"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user