[INTERPRETER]

* NEW: Relative paths beginning with ".../" always refer to files stored in 
  the main project archive.


git-svn-id: svn://localhost/gambas/trunk@7346 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2015-09-26 08:43:50 +00:00
parent 0a9262a2d8
commit 647c900268

View file

@ -333,36 +333,44 @@ bool ARCHIVE_find_from_path(ARCHIVE **parch, const char **ppath)
//fprintf(stderr, "ARCHIVE_find_from_path: %s (%s)\n", *ppath, *parch ? (*parch)->name : "NULL"); //fprintf(stderr, "ARCHIVE_find_from_path: %s (%s)\n", *ppath, *parch ? (*parch)->name : "NULL");
i = 0; if (strncmp(*ppath, ".../", 4) == 0)
while (strncmp(*ppath, "../", 3) == 0)
{ {
*ppath += 3; *ppath += 4;
if (*parch == NULL || *parch == ARCHIVE_main) *parch = NULL;
continue; }
else
while (i < STACK_frame_count) {
i = 0;
while (strncmp(*ppath, "../", 3) == 0)
{ {
class = STACK_frame[i].cp; *ppath += 3;
//fprintf(stderr, "[%d] %s / %s\n", i, class ? class->name : "NULL", class && class->component && class->component->archive ? class->component->archive->name : "NULL"); if (*parch == NULL || *parch == ARCHIVE_main)
if (class) continue;
while (i < STACK_frame_count)
{ {
if (!class->component) class = STACK_frame[i].cp;
//fprintf(stderr, "[%d] %s / %s\n", i, class ? class->name : "NULL", class && class->component && class->component->archive ? class->component->archive->name : "NULL");
if (class)
{ {
*parch = NULL; if (!class->component)
break; {
} *parch = NULL;
if (class->component && class->component->archive != *parch) break;
{ }
*parch = class->component->archive; if (class->component && class->component->archive != *parch)
break; {
*parch = class->component->archive;
break;
}
} }
i++;
} }
i++; if (i == STACK_frame_count)
*parch = NULL;
} }
if (i == STACK_frame_count)
*parch = NULL;
} }
if (*parch == NULL && EXEC_arch) if (*parch == NULL && EXEC_arch)