From f49fc4a0df3ed54a07c44918dd2ad5a4e0624c77 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Thu, 26 May 2016 09:26:09 +0100 Subject: [PATCH 1/1] progs/key.c: Report full parameter-key name in errors about it. --- progs/key.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/progs/key.c b/progs/key.c index 05494691..597b93a7 100644 --- a/progs/key.c +++ b/progs/key.c @@ -242,6 +242,7 @@ static int copyparam(keyopts *k, const char **pp) key_attriter i; key_data *kd; const char *n, *v; + dstr t = DSTR_INIT; kf.f = KCAT_SHARE; kf.m = KF_CATMASK; @@ -253,12 +254,17 @@ static int copyparam(keyopts *k, const char **pp) /* --- Run through the checklist --- */ + key_fulltag(k->p, &t); while (*pp) { key_data *kd = key_structfind(k->p->k, *pp); - if (!kd) - die(EXIT_FAILURE, "bad parameter key: parameter `%s' not found", *pp); - if (!KEY_MATCH(kd, &kf)) - die(EXIT_FAILURE, "bad parameter key: subkey `%s' is not shared", *pp); + if (!kd) { + die(EXIT_FAILURE, + "bad parameter key `%s': parameter `%s' not found", t.buf, *pp); + } + if (!KEY_MATCH(kd, &kf)) { + die(EXIT_FAILURE, + "bad parameter key `%s': subkey `%s' is not shared", t.buf, *pp); + } pp++; } @@ -276,6 +282,7 @@ static int copyparam(keyopts *k, const char **pp) /* --- Done --- */ + dstr_destroy(&t); return (1); } -- 2.11.0