new text conversion and string code (big changes, take care please)

This commit is contained in:
Vítor Santos Costa
2013-12-02 14:49:41 +00:00
parent 8b7fa9be36
commit d7397b43af
65 changed files with 1498 additions and 2098 deletions

View File

@@ -186,12 +186,14 @@ Yap_InitSysPath(void) {
int commons_done = FALSE;
{
char *dir;
if ((dir = Yap_RegistryGetString("library"))) {
if ((dir = Yap_RegistryGetString("library")) &&
is_directory(dir)) {
Yap_PutValue(AtomSystemLibraryDir,
MkAtomTerm(Yap_LookupAtom(dir)));
dir_done = TRUE;
}
if ((dir = Yap_RegistryGetString("prolog_commons"))) {
if ((dir = Yap_RegistryGetString("prolog_commons")) &&
is_directory(dir)) {
Yap_PutValue(AtomPrologCommonsDir,
MkAtomTerm(Yap_LookupAtom(dir)));
commons_done = TRUE;
@@ -207,8 +209,7 @@ Yap_InitSysPath(void) {
int buflen;
char *pt;
if ((fatts = GetFileAttributes(LOCAL_FileNameBuf)) == 0xFFFFFFFFL ||
!(fatts & FILE_ATTRIBUTE_DIRECTORY)) {
if (!is_directory(LOCAL_FileNameBuf)) {
/* couldn't find it where it was supposed to be,
let's try using the executable */
if (!GetModuleFileNameEx( GetCurrentProcess(), NULL, LOCAL_FileNameBuf, YAP_FILENAME_MAX)) {