aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-05-30 16:39:20 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-05-31 10:54:42 -0700
commita1844ff571d7dc4c7044dfa624ca9b8feef0fa68 (patch)
tree039cdc6d5f87dfafaab8a01cd69dc8e88bfba664
parent2bb88b8c065113df820bd1b349edb11c6a4789f0 (diff)
downloadconsfigurator-a1844ff571d7dc4c7044dfa624ca9b8feef0fa68.tar.gz
FILE:UPDATE-UNIX-TABLE: update lines whenever there's a match
Bug fix. Previously, we were updating only in the special case of taking the source from the existing line, and otherwise just appending another copy of the entry. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--src/property/file.lisp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/property/file.lisp b/src/property/file.lisp
index e4e0a3d..1bfda29 100644
--- a/src/property/file.lisp
+++ b/src/property/file.lisp
@@ -451,11 +451,11 @@ NO-SOURCE or \"PLACEHOLDER\", use the existing field value."
and line-target = (nth target line-fields)
for entry = (when-let* ((entry (gethash line-target pending))
(fields (fields entry)))
- (and (member (nth source fields)
- unknown :test #'string=)
- (not (string= line-source no-source))
- (setf (nth source fields) line-source)
- (format nil "~{~A~^ ~}" fields)))
+ (when (and (member (nth source fields)
+ unknown :test #'string=)
+ (not (string= line-source no-source)))
+ (setf (nth source fields) line-source))
+ (format nil "~{~A~^ ~}" fields))
if entry
collect it into accum and do (remhash line-target pending)
else collect line into accum