#include <cstdlib>
-#include <unistd.h>
#include <msp/fs/dir.h>
#include <msp/io/console.h>
#include <msp/io/file.h>
string ExternalTask::get_command() const
{
string cmd;
- for(vector<string>::const_iterator i=argv.begin(); i!=argv.end(); ++i)
+ for(const string &a: argv)
{
- if(i!=argv.begin())
+ if(!cmd.empty())
cmd += ' ';
- for(string::const_iterator j=i->begin(); j!=i->end(); ++j)
+ for(char c: a)
{
- if(*j=='"' || *j=='\'' || *j==' ' || *j=='\\' || *j=='&')
+ if(c=='"' || c=='\'' || c==' ' || c=='\\' || c=='&')
cmd += '\\';
- cmd += *j;
+ cmd += c;
}
}