From 90980a217c380956f112e1d1f36a53fe2b4ee9fd Mon Sep 17 00:00:00 2001 From: SANO Masatoshi Date: Wed, 19 Apr 2017 10:05:01 +0200 Subject: [PATCH] roswell.util:config returns nil when the value is empty. --- lisp/config.ros | 2 +- lisp/util.lisp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/config.ros b/lisp/config.ros index e22cc72..4831073 100644 --- a/lisp/config.ros +++ b/lisp/config.ros @@ -56,7 +56,7 @@ exec ros +R +Q -m roswell -L sbcl-bin -- $0 "$@" (setf conf (config conf (second argv) (third argv))) (save-config path conf) 0) ((and (equal (first argv) "show") (= 2 len)) - (format t "~A~%" (third (find (second argv) conf :test 'equal :key #'first))) 0) + (format t "~A~%" (or (third (find (second argv) conf :test 'equal :key #'first)) "")) 0) ((= 2 len) (setf conf (config conf (first argv) (second argv))) (save-config path conf) 0) diff --git a/lisp/util.lisp b/lisp/util.lisp index 01b0696..26517a3 100644 --- a/lisp/util.lisp +++ b/lisp/util.lisp @@ -115,7 +115,8 @@ (roswell:roswell `("roswell-internal-use" "core-extention" ,impl) :string t)) (defun config (c) - (roswell:roswell `("config" "show" ,c) :string t)) + (let ((result (roswell:roswell `("config" "show" ,c) :string t))) + (unless (zerop (length result)) result))) (defun (setf config) (val item) (roswell:roswell `("config" "set" ,item ,val) :string t)