From: Stas Boukarev Date: Mon, 29 Apr 2013 19:40:41 +0000 (+0400) Subject: Fix init-var-ignoring-errors. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=a92a8d84d5b97d7504437bdcb04917162609a66c;p=sbcl.git Fix init-var-ignoring-errors. Actually set the variable to the default value in case of an error. Caught by Nikodemus Siivola. --- diff --git a/src/code/common-os.lisp b/src/code/common-os.lisp index 081ccc1..66ef963 100644 --- a/src/code/common-os.lisp +++ b/src/code/common-os.lisp @@ -25,18 +25,18 @@ &key default explanation (condition 'error)) - `(handler-case - (setf ,variable ,form) - (,condition (c) - (let ((default ,default)) - (warn "Error initializing ~a~@[ ~a~]:~@ + `(setf ,variable + (handler-case ,form + (,condition (c) + (let ((default ,default)) + (warn "Error initializing ~a~@[ ~a~]:~@ ~a ~% Using ~s instead." - ',variable - ,explanation - c - default) - default)))) + ',variable + ,explanation + c + default) + default))))) ;;; If something ever needs to be done differently for one OS, then ;;; split out the different part into per-os functions. diff --git a/src/code/toplevel.lisp b/src/code/toplevel.lisp index 54819e1..9632d08 100644 --- a/src/code/toplevel.lisp +++ b/src/code/toplevel.lisp @@ -497,7 +497,8 @@ any non-negative real number." ;; Delete all the options that we processed, so that only ;; user-level options are left visible to user code. - (setf (rest *posix-argv*) options) + (when *posix-argv* + (setf (rest *posix-argv*) options)) ;; Disable debugger before processing initialization files & co. (when disable-debugger