add getopt reset support
based on proposed patches by Daniel Cegiełka, with minor changes: - use a weak symbol for optreset so it doesn't clash with namespace - also reset optpos (position in multi-option arg like -lR) - also make getopt_long support reset
This commit is contained in:
parent
e44849f5cf
commit
030e526392
3 changed files with 19 additions and 3 deletions
|
|
@ -7,7 +7,7 @@ extern "C" {
|
|||
|
||||
int getopt(int, char * const [], const char *);
|
||||
extern char *optarg;
|
||||
extern int optind, opterr, optopt;
|
||||
extern int optind, opterr, optopt, optreset;
|
||||
|
||||
struct option
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue