diff options
| author | jsing <> | 2014-12-28 16:33:34 +0000 |
|---|---|---|
| committer | jsing <> | 2014-12-28 16:33:34 +0000 |
| commit | 0db06c1eec0a538f57d58fa71f21ac24ad9ce7b2 (patch) | |
| tree | ab40873152c866aa2c032afabb80df4d3c517ac1 | |
| parent | fc3f7c64d2079b7a0eee82331194b54f30799874 (diff) | |
| download | openbsd-0db06c1eec0a538f57d58fa71f21ac24ad9ce7b2.tar.gz openbsd-0db06c1eec0a538f57d58fa71f21ac24ad9ce7b2.tar.bz2 openbsd-0db06c1eec0a538f57d58fa71f21ac24ad9ce7b2.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.
Diffstat (limited to '')
| -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 || |
