-/* $OpenBSD: apps.c,v 1.20 2014/12/28 16:22:37 jsing Exp $ */
+/* $OpenBSD: apps.c,v 1.21 2014/12/28 16:33:34 jsing Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
/* See if there is a matching option... */
for (j = 0; opts[j].name != NULL; j++) {
- opt = &opts[j];
- if (strcmp(p, opt->name) == 0)
+ if (strcmp(p, opts[j].name) == 0)
break;
}
- if (opts[j].name == NULL)
+ opt = &opts[j];
+ if (opts->name == NULL && opts->type == 0)
goto unknown;
if (opt->type == OPTION_ARG ||