From: Christophe R. <cr...@us...> - 2013-05-23 20:19:39
|
The branch "master" has been updated in SBCL: via 2cabe4e99e16a0d92969414b23a8a065e5e41a72 (commit) from 5cb51577bd59c36822e90fb814564bb7d59ee37e (commit) - Log ----------------------------------------------------------------- commit 2cabe4e99e16a0d92969414b23a8a065e5e41a72 Author: Jingyi Hou <hou...@gm...> Date: Fri May 24 02:18:23 2013 +0800 search_for_executable() fails to process last part of PATH if PATH does not end with ':' --- src/runtime/runtime.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/src/runtime/runtime.c b/src/runtime/runtime.c index 49c007b..cacc9c7 100644 --- a/src/runtime/runtime.c +++ b/src/runtime/runtime.c @@ -287,6 +287,18 @@ search_for_executable(const char *argv0) return search; } } + /* The above for-loop fails to process the last part of PATH if PATH does + * not end with ':'. We may consider appending an extra ':' to the end of + * SEARCH. -- houjingyi 2013-05-24 */ + if (start != NULL && *start != '\0') { + snprintf(buf, PATH_MAX + 1, "%s/%s", start, argv0); + if (access(buf, F_OK) == 0) { + free(search); + search = copied_realpath(buf); + free(buf); + return search; + } + } free(search); free(buf); ----------------------------------------------------------------------- hooks/post-receive -- SBCL |