From 6bc545d5035faee387e0c4898a64b337e2995f53 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 10 Dec 2022 16:48:57 -0800 Subject: [PATCH] Use actual enum names in wgetopt No functional change here. --- src/wgetopt.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/wgetopt.cpp b/src/wgetopt.cpp index 9b4eae9d6..c37bf57cd 100644 --- a/src/wgetopt.cpp +++ b/src/wgetopt.cpp @@ -250,16 +250,14 @@ void wgetopter_t::_update_long_opt(int argc, string_array_t argv, const struct w woptind++; assert(nextchar[nameend] == '\0' || nextchar[nameend] == '='); if (nextchar[nameend] == '=') { - // Don't test has_arg with >, because some C compilers don't allow it to be used on - // enums. - if (pfound->has_arg) + if (pfound->has_arg != no_argument) woptarg = &nextchar[nameend + 1]; else { nextchar += std::wcslen(nextchar); *retval = '?'; return; } - } else if (pfound->has_arg == 1) { + } else if (pfound->has_arg == required_argument) { if (woptind < argc) woptarg = argv[woptind++]; else {