Escape a string for use inside bash double quotes.
(s: &str)
| 293 | |
| 294 | /// Escape a string for use inside bash double quotes. |
| 295 | fn shell_escape(s: &str) -> String { |
| 296 | s.replace('\\', "\\\\") |
| 297 | .replace('"', "\\\"") |
| 298 | .replace('$', "\\$") |
| 299 | .replace('`', "\\`") |
| 300 | .replace('\n', "\\n") |
| 301 | .replace('\r', "\\r") |
| 302 | } |
| 303 | |
| 304 | fn build_kernel_cmdline(config: &VmLaunchConfig) -> String { |
| 305 | let mut parts = vec![ |
nothing calls this directly
no outgoing calls
no test coverage detected