]> git.lyx.org Git - features.git/commitdiff
Fix bug #7982: LyX does not work if working directory a hard disk drive like D:\
authorEnrico Forestieri <forenr@lyx.org>
Mon, 14 May 2012 11:08:30 +0000 (13:08 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Mon, 14 May 2012 11:08:30 +0000 (13:08 +0200)
In this case, the working dir has already a slash at the end.
Appending another one would result in a path ending with a double slash,
which has a special meaning when used in TEXINPUTS (all subdirs would
be recursively scanned). So, avoid doing that.

src/Buffer.cpp

index 1dc5d592e506f46f66ae3b360ffd4d37c48ad3cc..ad119bdbf172a0d372756547eadab05a6cfeb8b1 100644 (file)
@@ -2713,7 +2713,11 @@ string Buffer::absFileName() const
 
 string Buffer::filePath() const
 {
-       return d->filename.onlyPath().absFileName() + "/";
+       int last = d->filename.onlyPath().absFileName().length() - 1;
+
+       return d->filename.onlyPath().absFileName()[last] == '/'
+               ? d->filename.onlyPath().absFileName()
+               : d->filename.onlyPath().absFileName() + "/";
 }