then exchange with previous non-options as if it were an option,
then skip everything else like a non-option. */
- if (d->optind != argc && !strcmp (argv[d->optind], "--"))
+ if (d->optind != argc && argv[d->optind] && !strcmp (argv[d->optind], "--"))
{
d->optind++;