From 6917ee449301c0951b71dba3abd88c5a89f7a2c4 Mon Sep 17 00:00:00 2001 From: inoguchi <> Date: Wed, 9 Sep 2020 12:47:46 +0000 Subject: Add option type OPTION_UL_VALUE_OR ok tb@ --- src/usr.bin/openssl/apps.c | 6 +++++- src/usr.bin/openssl/apps.h | 5 ++++- 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 @@ -/* $OpenBSD: apps.c,v 1.54 2019/07/14 03:30:45 guenther Exp $ */ +/* $OpenBSD: apps.c,v 1.55 2020/09/09 12:47:46 inoguchi Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -2299,6 +2299,10 @@ options_parse(int argc, char **argv, const struct option *opts, char **unnamed, *opt->opt.value |= opt->value; break; + case OPTION_UL_VALUE_OR: + *opt->opt.ulvalue |= opt->ulvalue; + break; + default: fprintf(stderr, "option %s - unknown type %i\n", 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 @@ -/* $OpenBSD: apps.h,v 1.23 2019/07/14 03:30:45 guenther Exp $ */ +/* $OpenBSD: apps.h,v 1.24 2020/09/09 12:47:46 inoguchi Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -303,6 +303,7 @@ struct option { OPTION_VALUE, OPTION_VALUE_AND, OPTION_VALUE_OR, + OPTION_UL_VALUE_OR, } type; union { char **arg; @@ -312,9 +313,11 @@ struct option { int (*func)(void); long *lvalue; int *value; + unsigned long *ulvalue; time_t *tvalue; } opt; const int value; + const unsigned long ulvalue; }; void options_usage(const struct option *opts); -- cgit v1.2.3-55-g6feb