From: Georg Baum Date: Sun, 1 Dec 2013 21:10:47 +0000 (+0100) Subject: Make -userdir available to child processes X-Git-Tag: 2.1.0rc1~377 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=08c5d34922d70e55344bf8043704cba33b713fb0;p=features.git Make -userdir available to child processes Otherwise tex2lyx would not find textclass.lst, and thus TeX import and paste from LaTeX would not work. --- diff --git a/src/LyX.cpp b/src/LyX.cpp index b777e55f4e..b576ac05a5 100644 --- a/src/LyX.cpp +++ b/src/LyX.cpp @@ -735,6 +735,18 @@ bool LyX::init() if (!setEnv("LyXDir", lyx_dir)) LYXERR(Debug::INIT, "\t... failed!"); + if (package().explicit_user_support() && getEnv(LYX_USERDIR_VER).empty()) { + // -userdir was given on the command line. + // Make it available to child processes, otherwise tex2lyx + // would not find all layout files, and other converters might + // use it as well. + string const user_dir = package().user_support().absFileName(); + LYXERR(Debug::INIT, "Setting " LYX_USERDIR_VER "... to \"" + << user_dir << '"'); + if (!setEnv(LYX_USERDIR_VER, user_dir)) + LYXERR(Debug::INIT, "\t... failed!"); + } + // // Read configuration files //