X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fmisc.cpp;h=35953a74efb00b4a1ad1e1979469eecd74427c72;hb=74266a6e650f019063cdcd1c9a7bd26d8f99041b;hp=37616a95f3dfeba4a5994d6f00eb727f04caaccf;hpb=1a46151c99a406123c4ddfc797a7841baf3e4cc2;p=builder.git diff --git a/source/misc.cpp b/source/misc.cpp index 37616a9..35953a7 100644 --- a/source/misc.cpp +++ b/source/misc.cpp @@ -6,7 +6,11 @@ using namespace std; using namespace Msp; -string run_command(const list &argv) +/** +Runs a command and returns its output as a string. The exit status of the +command is lost. +*/ +string run_command(const StringList &argv) { int pfd[2]; pipe(pfd); @@ -17,7 +21,7 @@ string run_command(const list &argv) if(pid==0) { char *argv_[argv.size()+1]; - for(CountingIterator::const_iterator> i=argv.begin(); i!=argv.end(); ++i) + for(CountingIterator i=argv.begin(); i!=argv.end(); ++i) argv_[i.count()]=strdup(i->c_str()); argv_[argv.size()]=0; close(pfd[0]);