From 544b34106aedd1a6b51e250ccf7592518f539d3d Mon Sep 17 00:00:00 2001 From: Stelian Ionescu Date: Sat, 10 Nov 2007 23:46:36 +0100 Subject: [PATCH] Handle comments in /etc files. Signed-off-by: Stelian Ionescu --- sockets/namedb/etc-files.lisp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sockets/namedb/etc-files.lisp b/sockets/namedb/etc-files.lisp index 2c109ff..103aff2 100644 --- a/sockets/namedb/etc-files.lisp +++ b/sockets/namedb/etc-files.lisp @@ -30,8 +30,10 @@ (defun split-etc-tokens (line) (declare (type string line)) - (split-sequence-if #'space-char-p line - :remove-empty-subseqs t)) + (let ((comment-start (position #\# line))) + (split-sequence-if #'space-char-p line + :remove-empty-subseqs t + :start 0 :end comment-start))) (defmacro serialize-etc-file (file) `(#msplit-etc-tokens (scan-file ,file #'read-line))) -- 2.11.4.GIT