File tree 1 file changed +5
-0
lines changed
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -340,6 +340,11 @@ path = "lib.rs"
340
340
let sysroot = if is_host { dir. join ( "HOST" ) } else { PathBuf :: from ( dir) } ;
341
341
std:: env:: set_var ( "MIRI_SYSROOT" , & sysroot) ; // pass the env var to the processes we spawn, which will turn it into "--sysroot" flags
342
342
if print_env {
343
+ // Escape an arbitrary string for the shell: by wrapping it in `'`, the only special
344
+ // character we have to worry about is `'` itself. Everything else is taken literally
345
+ // in these strings. `'` is encoded as `'"'"'`: the outer `'` end and being a
346
+ // `'`-quoted string, respectively; the `"'"` in the middle represents a single `'`.
347
+ // (We could use `'\''` instead of `'"'"'` if we wanted but let's avoid backslashes.)
343
348
println ! ( "MIRI_SYSROOT='{}'" , sysroot. display( ) . to_string( ) . replace( '\'' , r#"'"'"'"# ) ) ;
344
349
} else if !ask_user {
345
350
println ! ( "A libstd for Miri is now available in `{}`." , sysroot. display( ) ) ;
You can’t perform that action at this time.
0 commit comments