From 5de09241cd4b79821cc5e1df5d0ff7b45e265ab5 Mon Sep 17 00:00:00 2001 From: Tyge Løvset <60263450+tylo-work@users.noreply.github.com> Date: Tue, 31 Mar 2020 22:29:26 +0200 Subject: Update copt.h --- ccl/copt.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ccl/copt.h b/ccl/copt.h index a2351b65..c694921c 100644 --- a/ccl/copt.h +++ b/ccl/copt.h @@ -113,7 +113,8 @@ static int copt_getopt(copt_t *opt, int argc, char *argv[], if (o->has_arg != copt_no_argument) { if (argv[opt->_i][j] == '=') opt->arg = &argv[opt->_i][j + 1]; - else if (argv[opt->_i][j] == '\0' && opt->_i < argc - 1 && (o->has_arg == copt_required_argument || argv[opt->_i + 1][0] != '-')) + else if (argv[opt->_i][j] == '\0' && opt->_i < argc - 1 && (o->has_arg == copt_required_argument || + argv[opt->_i + 1][0] != '-')) opt->arg = argv[++opt->_i]; else if (o->has_arg == copt_required_argument) optc = ':'; // missing option argument -- cgit v1.2.3