X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;ds=inline;f=ccan%2Fopt%2Ftest%2Futils.c;h=7378d844de74f4be986ca9ce43ea2f5fe91717b4;hb=f51a60f73a22533ec38c12fc63f2837e355a0f88;hp=9544fa77bd3493382c07e72f77f770d09b3d4cc7;hpb=6fa62e5ae1e29646aa718e99020fdf2efee74373;p=ccan diff --git a/ccan/opt/test/utils.c b/ccan/opt/test/utils.c index 9544fa77..7378d844 100644 --- a/ccan/opt/test/utils.c +++ b/ccan/opt/test/utils.c @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include "utils.h" @@ -49,6 +48,13 @@ void save_err_output(const char *fmt, ...) err_output = p; } +void reset_options(void) +{ + opt_free_table(); + free(err_output); + err_output = NULL; +} + static bool allocated = false; bool parse_args(int *argc, char ***argv, ...) @@ -70,8 +76,6 @@ bool parse_args(int *argc, char ***argv, ...) *argv = a; allocated = true; - /* Re-set before parsing. */ - optind = 0; return opt_parse(argc, *argv, save_err_output); }