mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
bbf: don't remove the dot at the end of the value if there is already a dot at the end
This commit is contained in:
parent
c3502d1085
commit
c9789e90d6
1 changed files with 5 additions and 1 deletions
|
|
@ -295,10 +295,14 @@ static void resolve_all_symbols(struct dmctx *ctx, void *data, char *instance, c
|
|||
{
|
||||
char *pch = NULL, *pchr = NULL;
|
||||
char buf_key[256] = {0};
|
||||
bool has_dot = false;
|
||||
unsigned pos = 0;
|
||||
|
||||
DM_STRNCPY(buf_key, old_key, sizeof(buf_key));
|
||||
|
||||
if (buf_key[strlen(buf_key) - 1] == '.')
|
||||
has_dot = true;
|
||||
|
||||
for (pch = strtok_r(buf_key, ".", &pchr); pch != NULL; pch = strtok_r(NULL, ".", &pchr)) {
|
||||
|
||||
if (strcmp(pch, "@Name") == 0)
|
||||
|
|
@ -317,7 +321,7 @@ static void resolve_all_symbols(struct dmctx *ctx, void *data, char *instance, c
|
|||
pos += snprintf(&new_key[pos], key_len - pos, "%s.", pch);
|
||||
}
|
||||
|
||||
if (pos)
|
||||
if (pos && !has_dot)
|
||||
new_key[pos - 1] = 0;
|
||||
|
||||
if (strstr(new_key, "{i}"))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue