summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2014-12-28 16:33:34 +0000
committerjsing <jsing@openbsd.org>2014-12-28 16:33:34 +0000
commit73bf9b7891a9751969f2c4765de06bb7a1adde16 (patch)
tree12cfe00c5ae7a117efb15d16611b0810ba339b15
parentAdd regress tests for multiple argument callback functions. (diff)
downloadwireguard-openbsd-73bf9b7891a9751969f2c4765de06bb7a1adde16.tar.xz
wireguard-openbsd-73bf9b7891a9751969f2c4765de06bb7a1adde16.zip
Allow a default option to be specified by having a NULL name, but a valid
option type. In this case process the option as per normal.
-rw-r--r--usr.bin/openssl/apps.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/openssl/apps.c b/usr.bin/openssl/apps.c
index 1155278b791..1a52e7681b8 100644
--- a/usr.bin/openssl/apps.c
+++ b/usr.bin/openssl/apps.c
@@ -1,4 +1,4 @@
-/* $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>
*
@@ -2288,11 +2288,11 @@ options_parse(int argc, char **argv, struct option *opts, char **unnamed,
/* 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 ||