* 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. */
| 168 | * @note This is intended for help, not for security-sensitive purposes. |
| 169 | */ |
| 170 | std::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 |
no test coverage detected