Michael Gerz schrieb:
Something very bad is going on in makeRelPath:
// Make relative path out of two absolute paths
string const makeRelPath(string const & abspath, string const &
basepath)
// Makes relative path out of absolute path. If it is deeper than
basepath,
// it's easy. If basepath and abspath share something (they are
all deeper
// than some directory), it'll be rendered using ..'s. If they
are completely
// different, then the absolute path will be used as relative path.
{
lyxerr << "makeRel " << abspath << endl;
string::size_type const abslen = abspath.length();
string::size_type const baselen = basepath.length();
lyxerr << "abspath " << abslen << " " <<
from_utf8(abspath).length() << endl;
// FIXME UNICODE
docstring::size_type i =
os::common_path(from_utf8(abspath),
from_utf8(basepath));
In my case, abspath is printed on the console and AFAICS, it has more
than 80 characters (roughly counted).
However, the second output gives "abspath 56 55"! That means
- the length of abspath is not computed correctly
- the length of the string and the converted docstring are not identical
=> I am not surprised that things don't work.
Sorry, 56 and 55 are hex values! So the only problem is the difference
between both values.
Michael