Filter out NIL from group lines.

Pascal J. Bourguignon [2018-11-04 15:49]
Filter out NIL from group lines.
Filename
common-lisp/unix/group.lisp
diff --git a/common-lisp/unix/group.lisp b/common-lisp/unix/group.lisp
index 414d429..ceab77c 100644
--- a/common-lisp/unix/group.lisp
+++ b/common-lisp/unix/group.lisp
@@ -108,11 +108,12 @@ DO:                 Read the group file.
 GROUP-FILE-PATH:    The pathname to the group file; default: \"/etc/group\"
 RETURN:             A list of group GROUP structures.
 "
-  (mapcar (function parse-group)
-          (with-open-file (in group-file-path
-                              :direction :input
-                              :if-does-not-exist :error)
-            (stream-to-string-list in))))
+  (delete nil
+          (mapcar (function parse-group)
+                  (with-open-file (in group-file-path
+                                      :direction :input
+                                      :if-does-not-exist :error)
+                    (stream-to-string-list in)))))


 ;;;; THE END ;;;
ViewGit