summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorinoguchi <>2020-09-09 12:47:46 +0000
committerinoguchi <>2020-09-09 12:47:46 +0000
commit6917ee449301c0951b71dba3abd88c5a89f7a2c4 (patch)
treea9d6c6210c2ead06b7f5cb378b1b4fd25cea0b5c /src
parentcb096711e5a5bfe60dece12c6bc854f5487ff5a4 (diff)
downloadopenbsd-6917ee449301c0951b71dba3abd88c5a89f7a2c4.tar.gz
openbsd-6917ee449301c0951b71dba3abd88c5a89f7a2c4.tar.bz2
openbsd-6917ee449301c0951b71dba3abd88c5a89f7a2c4.zip
Add option type OPTION_UL_VALUE_OR
ok tb@
Diffstat (limited to 'src')
-rw-r--r--src/usr.bin/openssl/apps.c6
-rw-r--r--src/usr.bin/openssl/apps.h5
2 files changed, 9 insertions, 2 deletions
diff --git a/src/usr.bin/openssl/apps.c b/src/usr.bin/openssl/apps.c
index c9a2f34b25..2c2f128484 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.54 2019/07/14 03:30:45 guenther Exp $ */ 1/* $OpenBSD: apps.c,v 1.55 2020/09/09 12:47:46 inoguchi Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -2299,6 +2299,10 @@ options_parse(int argc, char **argv, const struct option *opts, char **unnamed,
2299 *opt->opt.value |= opt->value; 2299 *opt->opt.value |= opt->value;
2300 break; 2300 break;
2301 2301
2302 case OPTION_UL_VALUE_OR:
2303 *opt->opt.ulvalue |= opt->ulvalue;
2304 break;
2305
2302 default: 2306 default:
2303 fprintf(stderr, "option %s - unknown type %i\n", 2307 fprintf(stderr, "option %s - unknown type %i\n",
2304 opt->name, opt->type); 2308 opt->name, opt->type);
diff --git a/src/usr.bin/openssl/apps.h b/src/usr.bin/openssl/apps.h
index 48e5ba3adb..10612a9c97 100644
--- a/src/usr.bin/openssl/apps.h
+++ b/src/usr.bin/openssl/apps.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: apps.h,v 1.23 2019/07/14 03:30:45 guenther Exp $ */ 1/* $OpenBSD: apps.h,v 1.24 2020/09/09 12:47:46 inoguchi Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -303,6 +303,7 @@ struct option {
303 OPTION_VALUE, 303 OPTION_VALUE,
304 OPTION_VALUE_AND, 304 OPTION_VALUE_AND,
305 OPTION_VALUE_OR, 305 OPTION_VALUE_OR,
306 OPTION_UL_VALUE_OR,
306 } type; 307 } type;
307 union { 308 union {
308 char **arg; 309 char **arg;
@@ -312,9 +313,11 @@ struct option {
312 int (*func)(void); 313 int (*func)(void);
313 long *lvalue; 314 long *lvalue;
314 int *value; 315 int *value;
316 unsigned long *ulvalue;
315 time_t *tvalue; 317 time_t *tvalue;
316 } opt; 318 } opt;
317 const int value; 319 const int value;
320 const unsigned long ulvalue;
318}; 321};
319 322
320void options_usage(const struct option *opts); 323void options_usage(const struct option *opts);