escape `{` in cmd for deprecated `Substring(std::string...)`
authorDominik Gabi <dominik@fb.com>
Fri, 16 Sep 2016 22:00:43 +0000 (15:00 -0700)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Fri, 16 Sep 2016 22:08:33 +0000 (15:08 -0700)
Summary:
Since `shellify` interprets the command as a format string we need to escape
`{` and `}`.

Reviewed By: ldemailly, simpkins

Differential Revision: D3874605

fbshipit-source-id: f47db387c3a44a3ba1c0c1d4726b7212fcb5ef3e

folly/Subprocess.cpp

index 912b54f2b25bf5cfb1aed0baa61b993217e51baf..93e3f577157a1ad324411eaa3bafdc6ad1292b5f 100644 (file)
@@ -184,7 +184,7 @@ Subprocess::Subprocess(
     throw std::invalid_argument("usePath() not allowed when running in shell");
   }
 
-  auto argv = shellify(cmd);
+  std::vector<std::string> argv = {"/bin/sh", "-c", cmd};
   spawn(cloneStrings(argv), argv[0].c_str(), options, env);
 }