octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #49184] working directory removed from path af


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #49184] working directory removed from path after changing to a pathdef directory
Date: Mon, 26 Sep 2016 21:58:00 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0

Follow-up Comment #3, bug #49184 (project octave):

One further clarification: when the current directory is changed to a
directory that exists elsewhere on the load path, the entry that was
previously "." is transformed into the full path of the working directory. The
user is thus left with two duplicates of a given directory on the load path,
and the "." entry is gone.

Example:


>> s = strsplit (path, pathsep); s(1)
ans = 
{
  [1,1] = .
}
>> addpath /tmp
>> s = strsplit (path, pathsep); s(1:2)
ans = 
{
  [1,1] = .
  [1,2] = /tmp
}
>> cd /tmp
>> s = strsplit (path, pathsep); s(1:2)
ans = 
{
  [1,1] = /tmp
  [1,2] = /tmp
}
>> cd
>> s = strsplit (path, pathsep); s(1:2)
ans = 
{
  [1,1] = /tmp
  [1,2] = /tmp
}
>> addpath .
>> s = strsplit (path, pathsep); s(1:3)
ans = 
{
  [1,1] = .
  [1,2] = /tmp
  [1,3] = /tmp
}
>> 


I am guessing that the change that causes this has to do with when the string
"." is transformed into the absolute path of the current directory, and the
way the load path is using the absolute names of path entries. It probably
needs some special handling now to ensure that the "." entry is not lost or
transformed inadvertently, but I haven't found where this needs to be done
yet.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49184>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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