Commits

Jakub Wilk committed 1f4bd5e

system: simplify argv_to_command_line().

Comments (0)

Files changed (1)

   for (std::vector<std::string>::const_iterator parg = argv.begin(); parg != argv.end(); parg++)
   {
     buffer << "'";
-    if (parg->find_first_of("\\\'") == std::string::npos)
+    if (parg->find("\'") == std::string::npos)
       buffer << *parg;
     else
       for (std::string::const_iterator pch = parg->begin(); pch != parg->end(); pch++)
       {
-        if (*pch == '\\' || *pch == '\'')
-          buffer << "'\"\\" << *pch << "\"'";
+        if (*pch == '\'')
+          buffer << "'\\''";
         else
           buffer << *pch;
       }