MCPcopy Create free account
hub / github.com/Bitcoin-ABC/bitcoin-abc / ShellQuoteIfNeeded

Function ShellQuoteIfNeeded

src/rpc/util.cpp:151–159  ·  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

149 * @note This is intended for help, not for security-sensitive purposes.
150 */
151std::string ShellQuoteIfNeeded(const std::string &s) {
152 for (const char ch : s) {
153 if (ch == ' ' || ch == '\'' || ch == '"') {
154 return ShellQuote(s);
155 }
156 }
157
158 return s;
159}
160
161} // namespace
162

Callers 1

HelpExampleCliNamedFunction · 0.85

Calls 1

ShellQuoteFunction · 0.85

Tested by

no test coverage detected