summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2009-10-15 14:12:04 +0200
committerJiri Moskovcak <jmoskovc@redhat.com>2009-10-15 14:12:04 +0200
commitfa4876866f675061802674b2016ea3db7b53413e (patch)
tree017a1ae41eb6d842c8ce137c0002e2830edabd46
parentba6ab638512e5619b9955470b7158b3b1035de90 (diff)
parent04def0de8ab5854b82d48f7f72fe9076a5a7d24f (diff)
downloadabrt-fa4876866f675061802674b2016ea3db7b53413e.tar.gz
abrt-fa4876866f675061802674b2016ea3db7b53413e.tar.xz
abrt-fa4876866f675061802674b2016ea3db7b53413e.zip
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
-rw-r--r--lib/Plugins/CCpp.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp
index 34201174..04db283e 100644
--- a/lib/Plugins/CCpp.cpp
+++ b/lib/Plugins/CCpp.cpp
@@ -87,6 +87,18 @@ static std::string CreateHash(const std::string& pInput)
return hash_str;
}
+static std::string concat_str_vector(char **strings)
+{
+ std::string result;
+ while (*strings)
+ {
+ result += *strings++;
+ if (*strings)
+ result += ' ';
+ }
+ return result;
+}
+
static pid_t ExecVP(char** pArgs, uid_t uid, std::string& pOutput)
{
int pipeout[2];
@@ -107,11 +119,7 @@ static pid_t ExecVP(char** pArgs, uid_t uid, std::string& pOutput)
}
if (child == 0)
{
- VERB1 log("Executing: %s %s %s %s", pArgs[0]
- ,pArgs[1] ? pArgs[1] : ""
- ,pArgs[1] && pArgs[2] ? pArgs[2] : ""
- ,pArgs[1] && pArgs[2] && pArgs[3] ? pArgs[3] : ""
- );
+ VERB1 log("Executing: %s", concat_str_vector(pArgs).c_str());
close(pipeout[0]); /* read side of the pipe */
xmove_fd(pipeout[1], STDOUT_FILENO);
/* Make sure stdin is safely open to nothing */