diff options
| author | Sebastian Dröge <sebastian@centricular.com> | 2022-12-21 16:01:18 +0200 |
|---|---|---|
| committer | Sebastian Dröge <sebastian@centricular.com> | 2022-12-23 09:34:22 +0200 |
| commit | e97203c3f893893611818997bbeb0116ded2605f (patch) | |
| tree | 2009cb0a2e7f4acd6a5fddda6a0d0e152ecc55af /tests/rustdoc-js-std/parser-errors.js | |
| parent | 1d12c3cea30b8ba4a09650a9e9c46fe9fbe25f0b (diff) | |
| download | rust-e97203c3f893893611818997bbeb0116ded2605f.tar.gz rust-e97203c3f893893611818997bbeb0116ded2605f.zip | |
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
Diffstat (limited to 'tests/rustdoc-js-std/parser-errors.js')
0 files changed, 0 insertions, 0 deletions
