- Converted from A3 to A3t.
- Standardized on A3t::getWords, and unquoted args to run. This ought to
  fix a bug, but I'm on a plane and cannot look at the bug right now.
This commit is contained in:
Paul Beckingham 2014-04-24 13:21:22 -04:00
parent c5fd2700ef
commit 763ded488c

View file

@ -24,10 +24,12 @@
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#include <iostream> // TODO Remove
#include <cmake.h> #include <cmake.h>
#include <stdlib.h> #include <stdlib.h>
#include <Context.h> #include <Context.h>
#include <i18n.h> #include <i18n.h>
#include <text.h>
#include <CmdExec.h> #include <CmdExec.h>
extern Context context; extern Context context;
@ -46,21 +48,7 @@ CmdExec::CmdExec ()
int CmdExec::execute (std::string& output) int CmdExec::execute (std::string& output)
{ {
std::string command_line; std::string command_line;
std::vector <Arg>::iterator arg; join (command_line, " ", context.a3t.getWords ());
for (arg = context.a3.begin (); arg != context.a3.end (); ++arg)
{
if (arg != context.a3.begin () &&
arg->_raw != "execute" &&
arg->_category != Arg::cat_rc &&
arg->_category != Arg::cat_override)
{
if (command_line.length ())
command_line += " ";
command_line += "'" + arg->_raw + "'";
}
}
return system (command_line.c_str ()); return system (command_line.c_str ());
} }