Index: main/share/gb_file_temp.h =================================================================== --- main/share/gb_file_temp.h (revision 5776) +++ main/share/gb_file_temp.h (working copy) @@ -1130,7 +1130,21 @@ const char *FILE_find_gambas(void) { const char *path; + static char buf[sizeof(file_buffer)]; + path = getenv("GAMBAS_ROOT"); + if (path && *path) { + if (!FILE_is_dir(path)) { + fprintf(stderr, "WARNING: GAMBAS_ROOT defined but " + "not a directory. Ignoring.\n"); + goto ignore; + } + path = FILE_cat(path, "bin/gbx" GAMBAS_VERSION_STRING, NULL); + strcpy(buf, file_buffer); + return buf; + } +ignore: + if (FILE_exist(GAMBAS_LINK_PATH)) { path = FILE_readlink(GAMBAS_LINK_PATH);