- Fixed escaping of spaces for scp and curl
This commit is contained in:
Johannes Schlatow
2011-11-30 00:12:20 +01:00
parent edad4d2ee6
commit d8d2060b39
5 changed files with 69 additions and 23 deletions

View File

@@ -72,6 +72,22 @@ Transport* Transport::getTransport(const Uri& uri)
////////////////////////////////////////////////////////////////////////////////
int Transport::execute()
{
// quote arguments
std::vector<std::string>::iterator it = _arguments.begin ();
for (; it != _arguments.end (); it++)
{
// quote until the first appearance of '{'
size_t pos = it->find('{');
if (pos != 0)
{
// '{' is not the first character
it->insert(0, "\"");
if (pos != std::string::npos)
it->insert(pos+1, "\"");
else
it->append("\"");
}
}
return ::execute(_executable, _arguments);
}