diff options
author | jsing <> | 2014-12-28 16:33:34 +0000 |
---|---|---|
committer | jsing <> | 2014-12-28 16:33:34 +0000 |
commit | b22c7be04463e72177bf89d6e8c6992f5af14710 (patch) | |
tree | ab40873152c866aa2c032afabb80df4d3c517ac1 | |
parent | 820ab7628dd07b64b052b91013ab938ac2b90d64 (diff) | |
download | openbsd-b22c7be04463e72177bf89d6e8c6992f5af14710.tar.gz openbsd-b22c7be04463e72177bf89d6e8c6992f5af14710.tar.bz2 openbsd-b22c7be04463e72177bf89d6e8c6992f5af14710.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-- | src/usr.bin/openssl/apps.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/usr.bin/openssl/apps.c b/src/usr.bin/openssl/apps.c index 1155278b79..1a52e7681b 100644 --- a/src/usr.bin/openssl/apps.c +++ b/src/usr.bin/openssl/apps.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: apps.c,v 1.20 2014/12/28 16:22:37 jsing Exp $ */ | 1 | /* $OpenBSD: apps.c,v 1.21 2014/12/28 16:33:34 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -2288,11 +2288,11 @@ options_parse(int argc, char **argv, struct option *opts, char **unnamed, | |||
2288 | 2288 | ||
2289 | /* See if there is a matching option... */ | 2289 | /* See if there is a matching option... */ |
2290 | for (j = 0; opts[j].name != NULL; j++) { | 2290 | for (j = 0; opts[j].name != NULL; j++) { |
2291 | opt = &opts[j]; | 2291 | if (strcmp(p, opts[j].name) == 0) |
2292 | if (strcmp(p, opt->name) == 0) | ||
2293 | break; | 2292 | break; |
2294 | } | 2293 | } |
2295 | if (opts[j].name == NULL) | 2294 | opt = &opts[j]; |
2295 | if (opts->name == NULL && opts->type == 0) | ||
2296 | goto unknown; | 2296 | goto unknown; |
2297 | 2297 | ||
2298 | if (opt->type == OPTION_ARG || | 2298 | if (opt->type == OPTION_ARG || |