If "doc:set:" or "doc:append:" is called with an empty key appended to
the name, find the key in ->str2.
This avoids the need for string allocation if the key is in a variable.
Signed-off-by: NeilBrown <neil@brown.name>
struct doc *d = ci->home->data;
const char *val = ksuffix(ci, "doc:set:");
+ if (!*val)
+ val = ci->str2;
+ if (!val)
+ return Enoarg;
+
if (strcmp(val, "autoclose") == 0) {
d->autoclose = ci->num;
return 1;
const char *val = ci->str;
const char *old;
+ if (!*attr)
+ attr = ci->str2;
+ if (!attr)
+ return Enoarg;
+
if (!val || !val[0])
return Enoarg;
/* Append the string to the attr. It attr doesn't