]> git.lyx.org Git - features.git/commitdiff
Fix bug #9342: LaTeX build get stuck for unconventional path name
authorEnrico Forestieri <forenr@lyx.org>
Thu, 27 Nov 2014 20:59:09 +0000 (21:59 +0100)
committerEnrico Forestieri <forenr@lyx.org>
Thu, 27 Nov 2014 20:59:09 +0000 (21:59 +0100)
The reason being that the TEXINPUTS path list was not quoted on Windows.
This was no problem with spaces but some special characters are
interpreted by the shell and can cause problems. In this particular
case, the '&' character was being interpreted as a command separator.

src/support/filetools.cpp

index 8efa780f22a3d1cd18d9b58cf3aa48231c393830..f145122ee8b2fd1d0c3413ccf00fa05646a06a03 100644 (file)
@@ -703,8 +703,15 @@ string latexEnvCmdPrefix(string const & path)
                return "env TEXINPUTS=\"." + sep + texinputs_prefix
                                          + sep + texinputs + "\" ";
        else
-               return "cmd /d /c set TEXINPUTS=." + sep + texinputs_prefix
-                                                  + sep + texinputs + "&";
+#ifndef USE_QPROCESS
+               return "cmd /d /c set \"TEXINPUTS=."
+                                               + sep + texinputs_prefix
+                                               + sep + texinputs + "\"&";
+#else
+               return "cmd /d /c set \"\"\"TEXINPUTS=."
+                                               + sep + texinputs_prefix
+                                               + sep + texinputs + "\"\"\"&";
+#endif
 }