From 864fc6578c4faac89da436a74b6355786b01112b Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Wed, 17 Jun 2009 20:25:10 +0200 Subject: [PATCH] If ECLDIR has no trailing / use TRUENAME to reinterpret is as a directory. --- src/c/unixfsys.d | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/c/unixfsys.d b/src/c/unixfsys.d index 65da587e8..d3db45363 100644 --- a/src/c/unixfsys.d +++ b/src/c/unixfsys.d @@ -890,7 +890,11 @@ cl_object si_get_library_pathname(void) { const char *v = getenv("ECLDIR"); - if (v) return make_constant_base_string(v); + cl_object s; + if (v) { + s = make_constant_base_string(v); + goto OUTPUT; + } #if defined(_MSC_VER) || defined(mingw32) { cl_object s = cl_alloc_adjustable_base_string(cl_core.path_max); @@ -911,10 +915,17 @@ si_get_library_pathname(void) s = cl_make_pathname(6, @':name', Cnil, @':type', Cnil, @':defaults', s); s = ecl_namestring(s, 0); + goto OUTPUT; } #else - return make_constant_base_string(ECLDIR "/"); + s = make_constant_base_string(ECLDIR "/"); #endif + OUTPUT: + /* Reinterpret filenames as directories. For instance /lib -> /lib/ */ + s = cl_truename(s); + /* Produce a string */ + s = ecl_namestring(s, 0); + return s; } @(defun ext::chdir (directory &optional (change_d_p_d Ct))