From 3a3f6c838c2ea88dbe38294f19e35ef9f39d4d2f Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Mon, 14 May 2012 13:08:30 +0200 Subject: [PATCH] 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 93ebb7a863377f6dbcaf724972b747b5c3f20c24) --- src/Buffer.cpp | 6 +++++- status.20x | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 8dbf9b1bfc..bba3610ad9 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -2624,7 +2624,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() + "/"; } diff --git a/status.20x b/status.20x index 1f52e2f8f8..3bcbb8bb22 100644 --- a/status.20x +++ b/status.20x @@ -130,6 +130,9 @@ What's new - 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 in View->Source (bug 7997).