X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fexternalaction.cpp;h=bde453f8c18b7321d0835ad54ce3913f93e0dfce;hb=7aeaa4ba965f596edad438c02e345a8843f7469a;hp=97f6c619f426cb16e50cef20aa170e2008b86ea7;hpb=57bdb055acb0453c75b22cb64f35cc0e817a2827;p=builder.git diff --git a/source/externalaction.cpp b/source/externalaction.cpp index 97f6c61..bde453f 100644 --- a/source/externalaction.cpp +++ b/source/externalaction.cpp @@ -1,6 +1,12 @@ +/* $Id$ + +This file is part of builder +Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions +Distributed under the LGPL +*/ + #include #include -#include #include "builder.h" #include "externalaction.h" @@ -14,7 +20,7 @@ int ExternalAction::check() signal_done.emit(); return 0; } - + if(!pid) return exit_code; @@ -48,7 +54,7 @@ void ExternalAction::launch() } cout<<'\n'; } - + if(builder.get_dry_run()) pid=-1; else @@ -57,9 +63,12 @@ void ExternalAction::launch() if(pid==0) { char *argv_[argv.size()+1]; - for(CountingIterator i=argv.begin(); i!=argv.end(); ++i) - argv_[i.count()]=strdup(i->c_str()); - argv_[argv.size()]=0; + + unsigned j=0; + for(StringList::iterator i=argv.begin(); i!=argv.end(); ++i) + argv_[j++]=strdup(i->c_str()); + argv_[j]=0; + execvp(argv_[0], argv_); cout<<"Couldn't execute "<