From 379519e84e6eafd352035fc2a74732e34d1af294 Mon Sep 17 00:00:00 2001 From: martin Date: Fri, 2 Apr 2010 13:11:07 +0000 Subject: [PATCH] Revert r4191 "Fix logic in pkcs15-tool/pkcs15-init -v" This reverts commit a61f61929647ed70f0258b2bcf1657fc5fef0fe1. git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4206 c6295689-39f2-0310-b995-f0e70906c6a9 --- src/tools/pkcs15-init.c | 9 +++------ src/tools/pkcs15-tool.c | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/tools/pkcs15-init.c b/src/tools/pkcs15-init.c index ce0e0bc6..b90d8e7b 100644 --- a/src/tools/pkcs15-init.c +++ b/src/tools/pkcs15-init.c @@ -344,7 +344,7 @@ static unsigned int opt_type = 0; static int ignore_cmdline_pins = 0; static struct secret opt_secrets[MAX_SECRETS]; static unsigned int opt_secret_count; -static int verbose = -1; +static int verbose = 0; static struct sc_pkcs15init_callbacks callbacks = { get_pin_callback, /* get_pin() */ @@ -562,10 +562,7 @@ open_reader_and_card(char *reader) util_error("Failed to establish context: %s\n", sc_strerror(r)); return 0; } - if (verbose > -1) - ctx->debug = verbose; - else - verbose = 0; + ctx->debug = verbose; if (verbose > 1) { ctx->debug_file = stderr; @@ -2520,7 +2517,7 @@ handle_option(const struct option *opt) opt_type = parse_objects(optarg, ACTION_CHANGE_ATTRIBUTES); break; case 'v': - verbose += (verbose == -1 ) ? 2 : 1; + verbose++; break; case 'f': opt_format = optarg; diff --git a/src/tools/pkcs15-tool.c b/src/tools/pkcs15-tool.c index a594bb29..38557315 100644 --- a/src/tools/pkcs15-tool.c +++ b/src/tools/pkcs15-tool.c @@ -55,7 +55,7 @@ static u8 * opt_newpin = NULL; static u8 * opt_pin = NULL; static u8 * opt_puk = NULL; -static int verbose = -1; +static int verbose = 0; enum { OPT_CHANGE_PIN = 0x100, @@ -1602,7 +1602,7 @@ int main(int argc, char * const argv[]) opt_outfile = optarg; break; case 'v': - verbose += (verbose == -1) ? 2 : 1; + verbose++; break; case 'a': opt_auth_id = optarg; @@ -1627,10 +1627,7 @@ int main(int argc, char * const argv[]) fprintf(stderr, "Failed to establish context: %s\n", sc_strerror(r)); return 1; } - if (verbose > -1) - ctx->debug = verbose; - else - verbose = 0; + ctx->debug = verbose; err = util_connect_card(ctx, &card, opt_reader, opt_wait, verbose); if (err)