Ok, I think this behavior is a bug (or I cannot see it's motivation):

I have a module A importing module I. Module B also imports I. I have
a baseline of modules and modules in my working area which are
supposed to take precedence over the modules in the baseline. So I set
the path accordingly: the (sub)directories of the working area preceed
the (sub)directories of the baseline. If modules I, A and B are in the
baseline and more up to date versions of A and I are in the working
area then chasing the imports from module A will load module I from
the working area and module B from the baseline. Then module I is
loaded *again* this time from the baseline, although it a) is already
loaded and b) the path is set so that it can be found in the working
area before searching the directories of the baseline.

Is there a reason to this behavior?

I narrowed it down to this in machdep.c


String findMPathname(along,nm,path)/* Look for a file along specified path   */
String along;                   /* If nonzero, a path prefix from along is */
String nm;                      /* used as the first prefix in the search. */
String path; {
    String pathpt = path;

    searchReset(0);
    if (along) {                /* Was a path for an existing file given?  */
        Int last = (-1);
        Int i    = 0;
        for (; along[i]; i++) {
            searchChr(along[i]);
            if (isSLASH(along[i]))
                last = i;
        }
        searchReset(last+1);
    }
    if (tryEndings(nm))
        return normPath(searchBuf);



Marko

Reply via email to