]> git.lyx.org Git - features.git/blobdiff - src/support/ForkedCalls.cpp
Implement on screen numbering for Subequation module
[features.git] / src / support / ForkedCalls.cpp
index 387f8561bfb55e459a337057cb9694076c50beb8..b9462153e04afb1e879efc3eae4397ee4800a4b4 100644 (file)
@@ -305,10 +305,7 @@ int ForkedCall::generateChild()
        if (command_.empty())
                return 1;
 
-       // Make sure that a V2 python is run, if available.
-       string const line = cmd_prefix_ +
-               (prefixIs(command_, "python -tt")
-                ? os::python() + command_.substr(10) : command_);
+       string const prefixed_command = cmd_prefix_ + command_;
 
 #if !defined (_WIN32)
        // POSIX
@@ -317,8 +314,8 @@ int ForkedCall::generateChild()
        // in a contiguous block of memory. The array contains pointers
        // to each word.
        // Don't forget the terminating `\0' character.
-       char const * const c_str = line.c_str();
-       vector<char> vec(c_str, c_str + line.size() + 1);
+       char const * const c_str = prefixed_command.c_str();
+       vector<char> vec(c_str, c_str + prefixed_command.size() + 1);
 
        // Splitting the command up into an array of words means replacing
        // the whitespace between words with '\0'. Life is complicated
@@ -382,7 +379,7 @@ int ForkedCall::generateChild()
        if (lyxerr.debugging(Debug::FILES)) {
                vector<char *>::iterator ait = argv.begin();
                vector<char *>::iterator const aend = argv.end();
-               lyxerr << "<command>\n\t" << line
+               lyxerr << "<command>\n\t" << prefixed_command
                       << "\n\tInterpreted as:\n\n";
                for (; ait != aend; ++ait)
                        if (*ait)
@@ -413,7 +410,7 @@ int ForkedCall::generateChild()
 
        startup.cb = sizeof(STARTUPINFO);
 
-       if (CreateProcess(0, (LPSTR)line.c_str(), 0, 0, FALSE,
+       if (CreateProcess(0, (LPSTR)command_.c_str(), 0, 0, FALSE,
                CREATE_NO_WINDOW, 0, 0, &startup, &process)) {
                CloseHandle(process.hThread);
                cpid = (pid_t)process.hProcess;
@@ -439,12 +436,6 @@ namespace ForkedCallQueue {
 
 /// A process in the queue
 typedef pair<string, ForkedCall::sigPtr> Process;
-/** Add a process to the queue. Processes are forked sequentially
- *  only one is running at a time.
- *  Connect to the returned signal and you'll be informed when
- *  the process has ended.
- */
-ForkedCall::sigPtr add(string const & process);
 
 /// in-progress queue
 static queue<Process> callQueue_;
@@ -459,6 +450,11 @@ void stopCaller();
 ///
 void callback(pid_t, int);
 
+/** Add a process to the queue. Processes are forked sequentially
+ *  only one is running at a time.
+ *  Connect to the returned signal and you'll be informed when
+ *  the process has ended.
+ */
 ForkedCall::sigPtr add(string const & process)
 {
        ForkedCall::sigPtr ptr;