rust/library/std
Dylan DPC 0e8f0b03cd
Rollup merge of #106001 - sdroege:glibc-skip-over-null-argv, r=ChrisDenton
Stop at the first `NULL` argument when iterating `argv`

Some C commandline parsers (e.g. GLib and Qt) are replacing already handled arguments in `argv` with `NULL` and move them to the end. That means that `argc` might be bigger than the actual number of non-`NULL` pointers in `argv` at this point.

To handle this we simply stop iterating at the first `NULL` argument.

`argv` is also guaranteed to be `NULL`-terminated so any non-`NULL` arguments after the first `NULL` can safely be ignored.

Fixes https://github.com/rust-lang/rust/issues/105999
2023-02-11 11:15:54 +05:30
..
benches
primitive_docs
src Rollup merge of #106001 - sdroege:glibc-skip-over-null-argv, r=ChrisDenton 2023-02-11 11:15:54 +05:30
tests Rollup merge of #105784 - yanns:update_stdarch, r=Amanieu 2023-01-27 12:57:53 +09:00
build.rs
Cargo.toml Update rand in the stdlib tests, and remove the getrandom feature from it 2023-01-04 14:52:41 -08:00