degesch: Lua: fix plugin configuration names
This commit is contained in:
parent
64143a5957
commit
83c14ba264
11
degesch.c
11
degesch.c
|
@ -7276,7 +7276,16 @@ plugin_config_name (struct plugin *self)
|
||||||
begin = p;
|
begin = p;
|
||||||
|
|
||||||
size_t len = strcspn (begin, ".");
|
size_t len = strcspn (begin, ".");
|
||||||
return len ? xstrndup (begin, len) : NULL;
|
if (!len)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// XXX: we might also allow arbitrary strings as object keys (except dots)
|
||||||
|
// taking care to use the "" syntax while serializing
|
||||||
|
char *copy = xstrndup (begin, len);
|
||||||
|
for (char *p = copy; *p; p++)
|
||||||
|
if (!config_tokenizer_is_word_char (*p))
|
||||||
|
*p = '_';
|
||||||
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Lua ---------------------------------------------------------------------
|
// --- Lua ---------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue