[LyX/master] Fix issues with tilde in inputpath

Juergen Spitzmueller spitz at lyx.org
Wed Nov 20 10:43:23 UTC 2019


commit a426b33067ae4e9d5452f13284f3e223d87ac45d
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Wed Nov 20 11:57:32 2019 +0100

    Fix issues with tilde in inputpath
    
    Fixes #11699
---
 src/Buffer.cpp |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 784c46e..0c0c9df 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -1940,11 +1940,12 @@ Buffer::ExportStatus Buffer::writeLaTeXSource(otexstream & os,
 					os << "\\catcode`\\%=11"
 					      "\\def\\%{%}\\catcode`\\%=14\n";
 				}
+				if (contains(docdir, '~'))
+					docdir = subst(docdir, "~", "\\string~");
 				bool const nonascii = !isAscii(from_utf8(docdir));
 				// LaTeX 2019/10/01 handles non-ascii path without detokenize
 				bool const utfpathlatex = features.isAvailable("LaTeX-2019/10/01");
-				bool const detokenize = !utfpathlatex
-						&& (nonascii || contains(docdir, '~'));
+				bool const detokenize = !utfpathlatex && nonascii;
 				bool const quote = contains(docdir, ' ');
 				if (utfpathlatex && nonascii)
 					os << "\\UseRawInputEncoding\n";


More information about the lyx-cvs mailing list