From ac688749879e4867bee0be6a07eec21a65cec585 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Mon, 3 Jun 2024 08:49:51 +0100 Subject: make: only reset getopt(3) if necessary Only invoke GETOPT_RESET() if getopt(3) has actually been called. --- miscutils/make.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miscutils/make.c b/miscutils/make.c index bcba080fe..f44de5df6 100644 --- a/miscutils/make.c +++ b/miscutils/make.c @@ -3051,9 +3051,9 @@ int make_main(int argc UNUSED_PARAM, char **argv) if (fargv0) { opts = process_options(fargv, TRUE); fargv = fargv0 + optind; + // Reset getopt(3) so we can call it again + GETOPT_RESET(); } - // Reset getopt(3) so we can call it again - GETOPT_RESET(); // Process options from the command line opts |= process_options(argv, FALSE); -- cgit v1.2.3-55-g6feb