]> git.lyx.org Git - features.git/commitdiff
Make sure the origin tag is properly terminated.
authorEnrico Forestieri <forenr@lyx.org>
Sun, 10 Jan 2016 22:17:59 +0000 (23:17 +0100)
committerEnrico Forestieri <forenr@lyx.org>
Sun, 10 Jan 2016 22:17:59 +0000 (23:17 +0100)
src/BufferParams.cpp

index fe47c05bf07792917f64d3e4ae61ea2920bc1d11..8024d4a5b13fcf0ff467241445a4db132820b745 100644 (file)
@@ -1015,11 +1015,11 @@ void BufferParams::writeFile(ostream & os, Buffer const * buf) const
        // The top of the file is written by the buffer.
        // Prints out the buffer info into the .lyx file given by file
 
-       // the document directory
-       // use realPath() instead of absFileName() for comparing
-       // so we can catch also eventually used symbolic parts of the path.
-       string filepath = buf->fileName().onlyPath().realPath();
-       string const sysdir = package().system_support().realPath();
+       // the document directory (must end with a path separator)
+       // realPath() is used to resolve symlinks, while addPath(..., "")
+       // ensures a trailing path separator.
+       string filepath = addPath(buf->fileName().onlyPath().realPath(), "");
+       string const sysdir = addPath(package().system_support().realPath(), "");
        string const relpath =
                to_utf8(makeRelPath(from_utf8(filepath), from_utf8(sysdir)));
        if (!prefixIs(relpath, "../") && !FileName::isAbsolute(relpath))