]> git.lyx.org Git - features.git/commitdiff
Make -userdir available to child processes
authorGeorg Baum <baum@lyx.org>
Sun, 1 Dec 2013 21:10:47 +0000 (22:10 +0100)
committerGeorg Baum <baum@lyx.org>
Sun, 1 Dec 2013 21:11:55 +0000 (22:11 +0100)
Otherwise tex2lyx would not find textclass.lst, and thus TeX import and
paste from LaTeX would not work.

src/LyX.cpp

index b777e55f4e45c289029333d1c4499a5bd047cb59..b576ac05a5e2925b4a5a7c09c09ca92c7cc005f2 100644 (file)
@@ -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
        //