Handle { NULL } argv[] properly in manual arg-reduction

Thanks izabera for reporting this!
This commit is contained in:
Laslo Hunhold
2017-08-05 23:50:39 +02:00
parent ea8622a4ce
commit e92a1aef54
22 changed files with 24 additions and 23 deletions

View File

@@ -35,7 +35,7 @@ main(int argc, char *argv[])
.follow = 'P', .flags = 0 };
size_t i;
argv0 = argv[0], argc--, argv++;
argv0 = *argv, argv0 ? (argc--, argv++) : (void *)0;
for (; *argv && (*argv)[0] == '-'; argc--, argv++) {
if (!(*argv)[1])