Changed to make use of environment variables if present. I think we'll
later should cut down on the defaults. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9763 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
84fed7e642
commit
c426897f56
@ -829,16 +829,36 @@ register_image(image_t *image, int fd, const char *path)
|
|||||||
static const char *
|
static const char *
|
||||||
search_path_for_type(image_type type)
|
search_path_for_type(image_type type)
|
||||||
{
|
{
|
||||||
|
const char *path = NULL;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case B_APP_IMAGE:
|
||||||
|
path = getenv("PATH");
|
||||||
|
break;
|
||||||
|
case B_LIBRARY_IMAGE:
|
||||||
|
path = getenv("LIBRARY_PATH");
|
||||||
|
break;
|
||||||
|
case B_ADD_ON_IMAGE:
|
||||||
|
path = getenv("ADDON_PATH");
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return NULL;
|
||||||
#if 0
|
#if 0
|
||||||
// ToDo: note, the getenv() call is not yet part of rld.so
|
|
||||||
case B_APP_IMAGE:
|
case B_APP_IMAGE:
|
||||||
return getenv("PATH");
|
return getenv("PATH");
|
||||||
case B_LIBRARY_IMAGE:
|
case B_LIBRARY_IMAGE:
|
||||||
return getenv("LIBRARY_PATH");
|
return getenv("LIBRARY_PATH");
|
||||||
case B_ADD_ON_IMAGE:
|
case B_ADD_ON_IMAGE:
|
||||||
return getenv("ADDON_PATH");
|
return getenv("ADDON_PATH");
|
||||||
#else
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// ToDo: for now, if the variable was not set, return default paths
|
||||||
|
if (path != NULL)
|
||||||
|
return path;
|
||||||
|
|
||||||
|
switch(type) {
|
||||||
case B_APP_IMAGE:
|
case B_APP_IMAGE:
|
||||||
return "/boot/home/config/bin:"
|
return "/boot/home/config/bin:"
|
||||||
"/bin:"
|
"/bin:"
|
||||||
@ -853,7 +873,7 @@ search_path_for_type(image_type type)
|
|||||||
|
|
||||||
case B_ADD_ON_IMAGE:
|
case B_ADD_ON_IMAGE:
|
||||||
return "%A/lib:/boot/home/config/lib:/boot/beos/system/lib";
|
return "%A/lib:/boot/home/config/lib:/boot/beos/system/lib";
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user