projects
/
sbcl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5cb5157
)
search_for_executable() fails to process last part of PATH if PATH does not end with ':'
author
Jingyi Hou
<houjingyi@gmail.com>
Thu, 23 May 2013 18:18:23 +0000
(
02:18
+0800)
committer
Christophe Rhodes
<csr21@cantab.net>
Thu, 23 May 2013 19:47:37 +0000
(20:47 +0100)
src/runtime/runtime.c
patch
|
blob
|
history
diff --git
a/src/runtime/runtime.c
b/src/runtime/runtime.c
index
49c007b
..
cacc9c7
100644
(file)
--- 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);