about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/example/std_example.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-02-23 06:18:06 +0100
committerGitHub <noreply@github.com>2023-02-23 06:18:06 +0100
commitc4a4bce6950260045576e9d50014fe0dfe178a1f (patch)
tree247b65857229d1b67d403aaff6d20e86544dc3de /compiler/rustc_codegen_gcc/example/std_example.rs
parenta423fa7b4683e6d8cf3abaaaf1567fbaccfb266b (diff)
parent0b7c867ec5e59bdae5e0646c99b369596a535909 (diff)
downloadrust-c4a4bce6950260045576e9d50014fe0dfe178a1f.tar.gz
rust-c4a4bce6950260045576e9d50014fe0dfe178a1f.zip
Rollup merge of #108218 - ChrisDenton:cmd-escape, r=cuviper
Windows: Quote more batch file arguments

Make sure to always quote batch file arguments that contain command prompt special characters.

Additionally add `/d` command line parameter to disable any autorun scripts that may change the way variable expansion works. This makes it more consistent across systems and may help avoid surprises.

## Background Info

[`CreateProcess`](https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw) with the `lpApplicationName` set can only be used to run `.exe` files and not script files such as `.bat`. However, for historical reasons, we do have special handling so that `.bat` files will be correctly run with `cmd.exe` as the application.

In Windows, command line arguments are passed as a single string (not an array). Applications can parse this string however they like but most follow the standard MSVC C/C++ convention. But `cmd.exe` uses different argument parsing rules to other Windows programs (because it emulates old DOS).  This PR aims to help smooth over some of the differences.

r? libs
Diffstat (limited to 'compiler/rustc_codegen_gcc/example/std_example.rs')
0 files changed, 0 insertions, 0 deletions