X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=lib%2Fgetopt.c;h=f1c0e1f24567aecde91a9953f571b1f8f279a5ec;hb=c38ee8cdbb19a3e84b3bb977098e89bd848e1ac1;hp=f1e6d1f7c702a4015baa324e85fe4fa41cb803e6;hpb=04176c5e3a481e57b4c6b10fdb6b4a5d82f213f2;p=tar diff --git a/lib/getopt.c b/lib/getopt.c index f1e6d1f..f1c0e1f 100644 --- a/lib/getopt.c +++ b/lib/getopt.c @@ -413,7 +413,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring, 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++;