]> git.lyx.org Git - features.git/commitdiff
On Windows, also fix call to octave (related to bug #7715).
authorEnrico Forestieri <forenr@lyx.org>
Tue, 23 Aug 2011 18:45:46 +0000 (18:45 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Tue, 23 Aug 2011 18:45:46 +0000 (18:45 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39513 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/filetools.cpp

index e54b92ab9e15b1ce1596b12074127a87dd95e672..dc01fcda8662ea06db4f2afb506db32355f9b4fe 100644 (file)
@@ -851,8 +851,14 @@ cmd_ret const runCommand(string const & cmd)
        SECURITY_ATTRIBUTES security;
        HANDLE in, out;
        FILE * inf = 0;
+       bool err2out = false;
        string command;
        string const infile = trim(split(cmd, command, '<'), " \"");
+       command = rtrim(command);
+       if (suffixIs(command, "2>&1")) {
+               command = rtrim(command, "2>&1");
+               err2out = true;
+       }
        string const cmdarg = "/c " + command;
        string const comspec = getEnv("COMSPEC");
 
@@ -867,7 +873,7 @@ cmd_ret const runCommand(string const & cmd)
                startup.cb = sizeof(STARTUPINFO);
                startup.dwFlags = STARTF_USESTDHANDLES;
 
-               startup.hStdError = GetStdHandle(STD_ERROR_HANDLE);
+               startup.hStdError = err2out ? out : GetStdHandle(STD_ERROR_HANDLE);
                startup.hStdInput = infile.empty()
                        ? GetStdHandle(STD_INPUT_HANDLE)
                        : CreateFile(infile.c_str(), GENERIC_READ,