We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f8b65f4 commit 250d6c7Copy full SHA for 250d6c7
flag.h
@@ -233,9 +233,11 @@ bool flag_parse(int argc, char **argv)
233
for (size_t i = 0; i < c->flags_count; ++i) {
234
bool is_name = strcmp(c->flags[i].name, flag) == 0;
235
bool is_alias = false;
236
- for (size_t j = 0; !is_alias && j < c->flags[i].alias_count; ++j) {
237
- if (strcmp(c->flags[i].aliases[j], flag) == 0)
238
- is_alias = true;
+ if (!is_name) {
+ for (size_t j = 0; !is_alias && j < c->flags[i].alias_count; ++j) {
+ if (strcmp(c->flags[i].aliases[j], flag) == 0)
239
+ is_alias = true;
240
+ }
241
}
242
if (is_name || is_alias) {
243
static_assert(COUNT_FLAG_TYPES == 4, "Exhaustive flag type parsing");
0 commit comments