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:
Judah Sotomayor 2023-12-21 01:47:21 -05:00
parent 3eb4b2d5d8
commit 283997b609
Signed by: judahsotomayor
SSH Key Fingerprint: SHA256:9Dq4ppxhfAjbX+7HLXEt+ROMiIojI6kqQgUyFUJb9lI

View File

@ -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))))