Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion sources/getopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ int getopt(int argc, char * const argv[], const char *optstring)
if (print_errors) {
fprintf(stderr, "%s: illegal option -- %c\r\n", argv[0], c);
}
sp = 1;
/* skip the illegal option character, otherwise we would return '?' forever */
if (argv[optind][sp + 1] == '\0') {
optind++;
sp = 1;
} else {
sp++;
}
optopt = c;
return '?';
} else if (cp[1] == ':') {
Expand Down
Loading