feat[read] Updated split-line regex
I updated the regex used in split-line to account for and discard comments. I also updated it to account for multiple = signs, such as in environment variable definitions.
This commit is contained in:
parent
3eb4b2d5d8
commit
283997b609
@ -39,7 +39,7 @@ This list maps section names to hash-tables of the settings in the section."
|
|||||||
"Split the given key=value line into an associated pair
|
"Split the given key=value line into an associated pair
|
||||||
and add it to the given hash-table"
|
and add it to the given hash-table"
|
||||||
|
|
||||||
(ppcre:register-groups-bind (systemd-variable setting-value ) ("(.*)=(.*)" line)
|
(ppcre:register-groups-bind (systemd-variable setting-value ) ("^(?!#)([^=]*)=(.*)" line)
|
||||||
(if (string/= setting-value "nil")
|
(if (string/= setting-value "nil")
|
||||||
(setf (gethash systemd-variable value-table ) setting-value )
|
(setf (gethash systemd-variable value-table ) setting-value )
|
||||||
(remhash systemd-variable value-table))))
|
(remhash systemd-variable value-table))))
|
||||||
|
Loading…
Reference in New Issue
Block a user