X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fexternaltask.cpp;h=33ffcebc4622889eaed085e371cc19fbb8a348df;hb=7c2db9e2b91da953701be233336c5bfa1f3c4af0;hp=16d1df096dd4a23eee3f60b2e54a8cf289de9884;hpb=32d6218afe58969f2b18dfa6e262bb9509829abe;p=builder.git diff --git a/source/externaltask.cpp b/source/externaltask.cpp index 16d1df0..33ffceb 100644 --- a/source/externaltask.cpp +++ b/source/externaltask.cpp @@ -31,16 +31,16 @@ ExternalTask::~ExternalTask() string ExternalTask::get_command() const { string cmd; - for(vector::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; } }