* 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. */
| 156 | * @note This is intended for help, not for security-sensitive purposes. |
| 157 | */ |
| 158 | std::string ShellQuoteIfNeeded(const std::string& s) |
| 159 | { |
| 160 | for (const char ch: s) { |
| 161 | if (ch == ' ' || ch == '\'' || ch == '"') { |
| 162 | return ShellQuote(s); |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | return s; |
| 167 | } |
| 168 | |
| 169 | } |
| 170 |
no test coverage detected