aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-06-18 15:57:41 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-06-18 15:57:41 -0700
commit1a19be7ea65fbfa0b192b2bf18a735f230f16675 (patch)
treef77308ec89588d8de13005b9ad7f897ed1b4879a
parentf2191929a8888e4b8799cda3c7c188020a4cabf6 (diff)
downloadconsfigurator-1a19be7ea65fbfa0b192b2bf18a735f230f16675.tar.gz
FILE:CONTAINS-INI-SETTINGS: fix extracting section names
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--src/property/file.lisp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/property/file.lisp b/src/property/file.lisp
index 324049b..10eb6ee 100644
--- a/src/property/file.lisp
+++ b/src/property/file.lisp
@@ -474,10 +474,13 @@ removed, and semicolon comment chars will be replaced with '#'."
(let ((new-lines
(loop with current-section
for line in lines
- for sec = (etypecase line
- (list (cadr line))
- (string (re:regex-replace
- parse-section line #?/\1/)))
+ for sec
+ = (etypecase line
+ (list (cadr line))
+ (string
+ (multiple-value-bind (match groups)
+ (re:scan-to-strings parse-section line)
+ (and match (elt groups 0)))))
and key = (and (listp line) (caddr line))
for pair = (cons sec key)
for val = (and (listp line) (gethash pair keys))