Backport fix for bug #7982: LyX does not work if working directory a

hard disk drive like D:\.

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.

(cherry picked from commit 93ebb7a863)
This commit is contained in:
Enrico Forestieri 2012-05-14 13:08:30 +02:00 committed by Richard Heck
parent b5d7ebd45c
commit 3a3f6c838c
2 changed files with 8 additions and 1 deletions

View File

@ -2624,7 +2624,11 @@ string Buffer::absFileName() const
string Buffer::filePath() 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() + "/";
} }

View File

@ -130,6 +130,9 @@ What's new
- Fixed an infinite loop when pasting '\\ ' into math (bug 8089). - Fixed an infinite loop when pasting '\\ ' into math (bug 8089).
- Fixed problem when setting working directory on Windows to root of a
disk, e.g., C:\ (bug 7982).
- Don't reset the selected format each time we click into a new paragraph - Don't reset the selected format each time we click into a new paragraph
in View->Source (bug 7997). in View->Source (bug 7997).