MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ShellQuoteIfNeeded

Function ShellQuoteIfNeeded

src/rpc/util.cpp:170–179  ·  view source on GitHub ↗

* Shell-quotes the argument if it needs quoting, else returns it literally, to save typing. * * @note This is intended for help, not for security-sensitive purposes. */

Source from the content-addressed store, hash-verified

168 * @note This is intended for help, not for security-sensitive purposes.
169 */
170std::string ShellQuoteIfNeeded(const std::string& s)
171{
172 for (const char ch: s) {
173 if (ch == ' ' || ch == '\'' || ch == '"') {
174 return ShellQuote(s);
175 }
176 }
177
178 return s;
179}
180
181}
182

Callers 1

HelpExampleCliNamedFunction · 0.85

Calls 1

ShellQuoteFunction · 0.85

Tested by

no test coverage detected