diff options
Diffstat (limited to 'src/usr.bin/openssl/apps.c')
| -rw-r--r-- | src/usr.bin/openssl/apps.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/usr.bin/openssl/apps.c b/src/usr.bin/openssl/apps.c index 506e421cc1..7c774e4077 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.17 2014/12/28 15:05:38 jsing Exp $ */ | 1 | /* $OpenBSD: apps.c,v 1.18 2014/12/28 15:48:52 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -2242,7 +2242,8 @@ options_usage(struct option *opts) | |||
| 2242 | } | 2242 | } |
| 2243 | 2243 | ||
| 2244 | int | 2244 | int |
| 2245 | options_parse(int argc, char **argv, struct option *opts, char **unnamed) | 2245 | options_parse(int argc, char **argv, struct option *opts, char **unnamed, |
| 2246 | int *argsused) | ||
| 2246 | { | 2247 | { |
| 2247 | const char *errstr; | 2248 | const char *errstr; |
| 2248 | struct option *opt; | 2249 | struct option *opt; |
| @@ -2260,6 +2261,8 @@ options_parse(int argc, char **argv, struct option *opts, char **unnamed) | |||
| 2260 | 2261 | ||
| 2261 | /* Single unnamed argument (without leading hyphen). */ | 2262 | /* Single unnamed argument (without leading hyphen). */ |
| 2262 | if (*p++ != '-') { | 2263 | if (*p++ != '-') { |
| 2264 | if (argsused != NULL) | ||
| 2265 | goto done; | ||
| 2263 | if (unnamed == NULL) | 2266 | if (unnamed == NULL) |
| 2264 | goto unknown; | 2267 | goto unknown; |
| 2265 | if (*unnamed != NULL) | 2268 | if (*unnamed != NULL) |
| @@ -2344,6 +2347,10 @@ options_parse(int argc, char **argv, struct option *opts, char **unnamed) | |||
| 2344 | } | 2347 | } |
| 2345 | } | 2348 | } |
| 2346 | 2349 | ||
| 2350 | done: | ||
| 2351 | if (argsused != NULL) | ||
| 2352 | *argsused = i; | ||
| 2353 | |||
| 2347 | return (0); | 2354 | return (0); |
| 2348 | 2355 | ||
| 2349 | toomany: | 2356 | toomany: |
