mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-02 17:41:05 +00:00
make NSBundle work, if cwd is not in PATH.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@738 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
df461b0a19
commit
50c0aa3ed4
1 changed files with 25 additions and 1 deletions
|
@ -96,6 +96,7 @@ objc_find_executable (const char *file)
|
||||||
{
|
{
|
||||||
char *search;
|
char *search;
|
||||||
register char *p;
|
register char *p;
|
||||||
|
int cwd_in_path = 0;
|
||||||
|
|
||||||
if (ABSOLUTE_FILENAME_P(file)) {
|
if (ABSOLUTE_FILENAME_P(file)) {
|
||||||
search = copy_of(file);
|
search = copy_of(file);
|
||||||
|
@ -122,7 +123,7 @@ objc_find_executable (const char *file)
|
||||||
*next = 0;
|
*next = 0;
|
||||||
if (*p) p++;
|
if (*p) p++;
|
||||||
|
|
||||||
if (name[0] == '.' && name[1] == 0)
|
if (name[0] == '.' && name[1] == 0) {
|
||||||
#ifndef NeXT
|
#ifndef NeXT
|
||||||
getcwd (name, MAXPATHLEN);
|
getcwd (name, MAXPATHLEN);
|
||||||
#else
|
#else
|
||||||
|
@ -132,10 +133,33 @@ objc_find_executable (const char *file)
|
||||||
*/
|
*/
|
||||||
getwd (name);
|
getwd (name);
|
||||||
#endif
|
#endif
|
||||||
|
cwd_in_path = 1;
|
||||||
|
}
|
||||||
|
|
||||||
strcat (name, "/");
|
strcat (name, "/");
|
||||||
strcat (name, file);
|
strcat (name, file);
|
||||||
|
|
||||||
|
/*
|
||||||
|
if (access (name, X_OK) == 0)
|
||||||
|
*/
|
||||||
|
if (find_full_path (name) == 0)
|
||||||
|
return copy_of (name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
If '.' not in PATH, check this too
|
||||||
|
*/
|
||||||
|
if (!cwd_in_path) {
|
||||||
|
char name[MAXPATHLEN];
|
||||||
|
|
||||||
|
#ifndef NeXT
|
||||||
|
getcwd (name, MAXPATHLEN);
|
||||||
|
#else
|
||||||
|
getwd (name);
|
||||||
|
#endif
|
||||||
|
strcat (name, "/");
|
||||||
|
strcat (name, file);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (access (name, X_OK) == 0)
|
if (access (name, X_OK) == 0)
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue