From: Dominik Gabi Date: Fri, 16 Sep 2016 22:00:43 +0000 (-0700) Subject: escape `{` in cmd for deprecated `Substring(std::string...)` X-Git-Tag: v2016.09.19.00~1 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d9749c81897ace66bbce2d428cca7118c0f53cd0;p=folly.git escape `{` in cmd for deprecated `Substring(std::string...)` 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 --- diff --git a/folly/Subprocess.cpp b/folly/Subprocess.cpp index 912b54f2..93e3f577 100644 --- a/folly/Subprocess.cpp +++ b/folly/Subprocess.cpp @@ -184,7 +184,7 @@ Subprocess::Subprocess( throw std::invalid_argument("usePath() not allowed when running in shell"); } - auto argv = shellify(cmd); + std::vector argv = {"/bin/sh", "-c", cmd}; spawn(cloneStrings(argv), argv[0].c_str(), options, env); }