From 030e52639248ac8417a4934298caa78c21a228d1 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 30 Sep 2012 20:00:38 -0400 Subject: add getopt reset support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- include/getopt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/getopt.h b/include/getopt.h index 6d85c0b6..c1d0df92 100644 --- a/include/getopt.h +++ b/include/getopt.h @@ -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 { -- cgit v1.2.3-70-g09d2