On Windows, also fix call to octave (related to bug #7715).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39513 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2011-08-23 18:45:46 +00:00
parent 6aaa3054e2
commit d68309ee17

View 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,