]> git.tdb.fi Git - builder.git/blobdiff - source/misc.cpp
Add comments
[builder.git] / source / misc.cpp
index 37616a95f3dfeba4a5994d6f00eb727f04caaccf..35953a74efb00b4a1ad1e1979469eecd74427c72 100644 (file)
@@ -6,7 +6,11 @@
 using namespace std;
 using namespace Msp;
 
-string run_command(const list<string> &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<string> &argv)
        if(pid==0)
        {
                char *argv_[argv.size()+1];
-               for(CountingIterator<const string, list<string>::const_iterator> i=argv.begin(); i!=argv.end(); ++i)
+               for(CountingIterator<const string, StringList::const_iterator> i=argv.begin(); i!=argv.end(); ++i)
                        argv_[i.count()]=strdup(i->c_str());
                argv_[argv.size()]=0;
                close(pfd[0]);