as a result of commit
e8e4e56a8ce1f3d7e4a027ff5478f2f8ea70c46b,
the later code path for setting optarg to a null pointer is no longer
necessary, and removing it eliminates an indention level and arguably
makes the code more readable.
return '?';
}
optarg = opt+1;
- } else {
- if (longopts[i].has_arg == required_argument) {
- if (!(optarg = argv[optind])) {
- if (colon) return ':';
- if (!opterr) return '?';
- __getopt_msg(argv[0],
- ": option requires an argument: ",
- longopts[i].name,
- strlen(longopts[i].name));
- return '?';
- }
- optind++;
- } else optarg = NULL;
+ } else if (longopts[i].has_arg == required_argument) {
+ if (!(optarg = argv[optind])) {
+ if (colon) return ':';
+ if (!opterr) return '?';
+ __getopt_msg(argv[0],
+ ": option requires an argument: ",
+ longopts[i].name,
+ strlen(longopts[i].name));
+ return '?';
+ }
+ optind++;
}
if (idx) *idx = i;
if (longopts[i].flag) {