os/sysbits.c
This commit is contained in:
parent
a5bb2e226c
commit
d00698b76a
57
os/sysbits.c
57
os/sysbits.c
@ -1263,7 +1263,7 @@ const char *Yap_findFile(const char *isource, const char *idef,
|
|||||||
case 0: // path or file name is given;
|
case 0: // path or file name is given;
|
||||||
root = iroot;
|
root = iroot;
|
||||||
if (!root && ftype == YAP_BOOT_PL) {
|
if (!root && ftype == YAP_BOOT_PL) {
|
||||||
root = YAP_PL_SRCDIR;
|
root = YAP_PL_SRCDIR;
|
||||||
}
|
}
|
||||||
if (idef || isource) {
|
if (idef || isource) {
|
||||||
source = (isource ? isource : idef);
|
source = (isource ? isource : idef);
|
||||||
@ -1281,20 +1281,20 @@ const char *Yap_findFile(const char *isource, const char *idef,
|
|||||||
#if HAVE_GETENV
|
#if HAVE_GETENV
|
||||||
if (in_lib) {
|
if (in_lib) {
|
||||||
if (ftype == YAP_SAVED_STATE || ftype == YAP_OBJ) {
|
if (ftype == YAP_SAVED_STATE || ftype == YAP_OBJ) {
|
||||||
root = getenv("YAPLIBDIR");
|
root = getenv("YAPLIBDIR");
|
||||||
} else if (ftype == YAP_BOOT_PL) {
|
} else if (ftype == YAP_BOOT_PL) {
|
||||||
root = getenv("YAPSHAREDIR");
|
root = getenv("YAPSHAREDIR");
|
||||||
if (root == NULL) {
|
if (root == NULL) {
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
strncpy(save_buffer, root, YAP_FILENAME_MAX);
|
strncpy(save_buffer, root, YAP_FILENAME_MAX);
|
||||||
strncat(save_buffer, "/pl", YAP_FILENAME_MAX);
|
strncat(save_buffer, "/pl", YAP_FILENAME_MAX);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
source = (isource ? isource : idef);
|
source = (isource ? isource : idef);
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
done = true;
|
done = true;
|
||||||
break;
|
break;
|
||||||
case 3: // use compilation variable YAPLIBDIR
|
case 3: // use compilation variable YAPLIBDIR
|
||||||
if (in_lib) {
|
if (in_lib) {
|
||||||
@ -1323,30 +1323,31 @@ const char *Yap_findFile(const char *isource, const char *idef,
|
|||||||
|
|
||||||
case 5: // search from the binary
|
case 5: // search from the binary
|
||||||
#ifndef __ANDROID__
|
#ifndef __ANDROID__
|
||||||
|
{
|
||||||
done = true;
|
done = true;
|
||||||
break;
|
} break;
|
||||||
#endif
|
#endif
|
||||||
const char *pt = Yap_FindExecutable();
|
{
|
||||||
|
const char *pt = Yap_FindExecutable();
|
||||||
|
|
||||||
if (pt) {
|
if (pt) {
|
||||||
if (ftype == YAP_BOOT_PL) {
|
if (ftype == YAP_BOOT_PL) {
|
||||||
root = "../../share/Yap/pl";
|
root = "../../share/Yap/pl";
|
||||||
} else {
|
} else {
|
||||||
root =
|
root = (ftype == YAP_SAVED_STATE || ftype == YAP_OBJ
|
||||||
(ftype == YAP_SAVED_STATE
|
? "../../lib/Yap"
|
||||||
|| ftype == YAP_OBJ
|
: "../../share/Yap");
|
||||||
? "../../lib/Yap"
|
}
|
||||||
: "../../share/Yap");
|
if (Yap_findFile(source, NULL, root, save_buffer, access, ftype,
|
||||||
}
|
expand_root, in_lib))
|
||||||
if (Yap_findFile(source, NULL, root, save_buffer, access, ftype,
|
root = save_buffer;
|
||||||
expand_root, in_lib))
|
else
|
||||||
root = save_buffer;
|
done = true;
|
||||||
else
|
} else {
|
||||||
done = true;
|
done = true;
|
||||||
} else {
|
}
|
||||||
done = true;
|
source = (isource ? isource : idef);
|
||||||
}
|
}
|
||||||
source = (isource ? isource : idef);
|
|
||||||
break;
|
break;
|
||||||
case 6: // default, try current directory
|
case 6: // default, try current directory
|
||||||
if (!isource && ftype == YAP_SAVED_STATE)
|
if (!isource && ftype == YAP_SAVED_STATE)
|
||||||
|
Reference in New Issue
Block a user