[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Doubled colon in LOADPATH not expanding to default path

From: John W. Eaton
Subject: Doubled colon in LOADPATH not expanding to default path
Date: Tue, 20 Oct 1998 21:03:58 -0500 (CDT)

On 20-Oct-1998, Rafael Laboissiere <address@hidden> wrote:

| Is it normal that a doubled colon in the middle of LOADPATH does not
| expand to the default path (as documented in the in kpathsea manual)?  I
| mean: when LOADPATH starts (ends) with a colon, the default path is
| prepended (appended) to its value, but if LOADPATH is equal to
| e.g. "a::b", the default path does not get expanded between "a:" and
| ":b".

I didn't know about this feature.  Perhaps I'm not using kpathsea as
well as I could, since none of Octave's path variables get default
values from a kpathsea config file.  I'll have to check on that.  In
any case, here is a quick patch that will make Octave do what you
want, at least for LOADPATH.



Tue Oct 20 20:58:04 1998  John W. Eaton  <address@hidden>

        * (maybe_add_default_load_path): If LOADPATH contains
        an embedded "::", insert the default path there too.

***        Fri Sep 25 14:20:55 1998
--- Tue Oct 20 20:57:45 1998
*** 262,267 ****
--- 262,277 ----
        if (pathstring[pathstring.length () - 1] == SEPCHAR)
        retval.append (std_path);
+       size_t pos = 0;
+       do
+       {
+         pos = retval.find ("::");
+         if (pos != NPOS)
+           retval.insert (pos+1, std_path);
+       }
+       while (pos != NPOS);
    return retval;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]