]> git.ozlabs.org Git - ccan/blobdiff - ccan/opt/opt.c
opt: remove unused debug function and code, test a few more corner cases.
[ccan] / ccan / opt / opt.c
index aa85325dd339c6b10f166a825aeec2ba4848400b..a5180706c45e28e52394411ad5ff271f10cdeb2c 100644 (file)
@@ -41,8 +41,6 @@ static const char *first_opt(unsigned *i, unsigned *len)
 
 static const char *next_opt(const char *p, unsigned *i, unsigned *len)
 {
 
 static const char *next_opt(const char *p, unsigned *i, unsigned *len)
 {
-       if (!p)
-               (*i)++;
        for (; *i < opt_count; (*i)++) {
                if (opt_table[*i].flags == OPT_SUBTABLE)
                        continue;
        for (; *i < opt_count; (*i)++) {
                if (opt_table[*i].flags == OPT_SUBTABLE)
                        continue;
@@ -259,13 +257,6 @@ static void parse_fail(void (*errlog)(const char *fmt, ...),
                       strcspn(longopt, "/"), longopt, problem);
 }
 
                       strcspn(longopt, "/"), longopt, problem);
 }
 
-void dump_optstate(void);
-void dump_optstate(void)
-{
-       printf("opterr = %i, optind = %i, optopt = %i, optarg = %s\n",
-              opterr, optind, optopt, optarg);
-}
-
 /* Parse your arguments. */
 bool opt_parse(int *argc, char *argv[], void (*errlog)(const char *fmt, ...))
 {
 /* Parse your arguments. */
 bool opt_parse(int *argc, char *argv[], void (*errlog)(const char *fmt, ...))
 {