From a757a48ad4a4531894203461ba5fb626a3ffc511 Mon Sep 17 00:00:00 2001 From: Juho Snellman Date: Fri, 1 Dec 2006 17:23:19 +0000 Subject: [PATCH] 1.0.0.9: Fix startup with an empty $HOME (reported by Peter Van Eynde). --- NEWS | 2 ++ src/code/filesys.lisp | 22 ++++++++++++---------- version.lisp-expr | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/NEWS b/NEWS index 7e172cfbe..cd951c74e 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,8 @@ changes in sbcl-1.0.1 relative to sbcl-1.0: * bug fix: non-required arguments were not passed correctly when a method defined using DEFMETHOD was called from a mop-generated method using CALL-NEXT-METHOD (reported by Pascal Costanza) + * bug fix: an error was signaled at startup if the HOME environment + variable was defined, but had an empty value (reported by Peter Van Eynde) * optimization: the FIND and POSITION family of sequence functions are significantly faster on arrays whose element types have been declared. diff --git a/src/code/filesys.lisp b/src/code/filesys.lisp index 1b8273090..53ff874e2 100644 --- a/src/code/filesys.lisp +++ b/src/code/filesys.lisp @@ -584,16 +584,18 @@ environment variable has been specified, the directory it designates is returned; otherwise obtains the home directory from the operating system." (declare (ignore host)) - (parse-native-namestring - (ensure-trailing-slash - (if (posix-getenv "HOME") - (posix-getenv "HOME") - #!-win32 - (sb!unix:uid-homedir (sb!unix:unix-getuid)) - #!+win32 - ;; Needs to bypass PARSE-NATIVE-NAMESTRING & ENSURE-TRAILING-SLASH - (return-from user-homedir-pathname - (sb!win32::get-folder-pathname sb!win32::csidl_profile)))))) + (let ((env-home (posix-getenv "HOME"))) + (parse-native-namestring + (ensure-trailing-slash + (if (and env-home + (not (equal env-home ""))) + env-home + #!-win32 + (sb!unix:uid-homedir (sb!unix:unix-getuid)) + #!+win32 + ;; Needs to bypass PARSE-NATIVE-NAMESTRING & ENSURE-TRAILING-SLASH + (return-from user-homedir-pathname + (sb!win32::get-folder-pathname sb!win32::csidl_profile))))))) (defun file-write-date (file) #!+sb-doc diff --git a/version.lisp-expr b/version.lisp-expr index 14a88683e..394585d4d 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.0.8" +"1.0.0.9" -- 2.11.4.GIT