We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0668c88 commit e8eac7bCopy full SHA for e8eac7b
compiler/rustc_codegen_ssa/src/back/command.rs
@@ -167,7 +167,10 @@ impl Command {
167
//
168
// [1]: https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessa
169
// [2]: https://devblogs.microsoft.com/oldnewthing/?p=41553
170
- let estimated_command_line_len = self.args.iter().map(|a| a.len()).sum::<usize>();
+ let estimated_command_line_len = self
171
+ .args
172
+ .iter()
173
+ .fold(0usize, |acc, a| acc.saturating_add(a.as_encoded_bytes().len()));
174
estimated_command_line_len > 1024 * 6
175
} else if cfg!(unix) {
176
// On Unix the limits can be gargantuan anyway so we're pretty
0 commit comments