~mdw
/
catacomb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
da4489a
)
progs/key.c: Report full parameter-key name in errors about it.
author
Mark Wooding
<mdw@distorted.org.uk>
Thu, 26 May 2016 08:26:09 +0000
(09:26 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Sat, 22 Apr 2017 19:17:04 +0000
(20:17 +0100)
progs/key.c
patch
|
blob
|
blame
|
history
diff --git
a/progs/key.c
b/progs/key.c
index
0549469
..
597b93a
100644
(file)
--- 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;
key_attriter i;
key_data *kd;
const char *n, *v;
+ dstr t = DSTR_INIT;
kf.f = KCAT_SHARE;
kf.m = KF_CATMASK;
kf.f = KCAT_SHARE;
kf.m = KF_CATMASK;
@@
-253,12
+254,17
@@
static int copyparam(keyopts *k, const char **pp)
/* --- Run through the checklist --- */
/* --- Run through the checklist --- */
+ key_fulltag(k->p, &t);
while (*pp) {
key_data *kd = key_structfind(k->p->k, *pp);
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++;
}
pp++;
}
@@
-276,6
+282,7
@@
static int copyparam(keyopts *k, const char **pp)
/* --- Done --- */
/* --- Done --- */
+ dstr_destroy(&t);
return (1);
}
return (1);
}