[INTERPRETER]

* NEW: Support for the GB_PATH environment variable, that gives the Gambas
  interpreter path if set.


git-svn-id: svn://localhost/gambas/trunk@5918 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2013-10-26 21:06:22 +00:00
parent db6e8a39b3
commit 27c21ea450
2 changed files with 14 additions and 8 deletions

View file

@ -215,6 +215,7 @@ COMPONENT *COMPONENT_create(const char *name)
path = FILE_buffer();
sprintf(path, LIB_PATTERN, COMPONENT_path, name);
//fprintf(stderr, "COMPONENT_create: %s\n", path);
if (FILE_exist(path))
comp->library = LIBRARY_create(name);

View file

@ -1138,15 +1138,20 @@ const char *FILE_find_gambas(void)
{
const char *path;
if (FILE_exist(GAMBAS_LINK_PATH))
path = getenv("GB_PATH");
if (!path || !*path)
{
path = FILE_readlink(GAMBAS_LINK_PATH);
if (!path)
path = GAMBAS_LINK_PATH;
}
else
{
path = GAMBAS_PATH "/gbx" GAMBAS_VERSION_STRING;
if (FILE_exist(GAMBAS_LINK_PATH))
{
path = FILE_readlink(GAMBAS_LINK_PATH);
if (!path)
path = GAMBAS_LINK_PATH;
}
else
{
path = GAMBAS_PATH "/gbx" GAMBAS_VERSION_STRING;
}
}
return path;