projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'collectd-4.6' into collectd-4.7
[collectd.git]
/
src
/
configfile.c
diff --git
a/src/configfile.c
b/src/configfile.c
index
c929d00
..
53f3314
100644
(file)
--- a/
src/configfile.c
+++ b/
src/configfile.c
@@
-172,7
+172,7
@@
static int cf_dispatch (const char *type, const char *orig_key,
free (key);
free (value);
free (key);
free (value);
- DEBUG ("return (%i)", ret);
+ DEBUG ("
cf_dispatch:
return (%i)", ret);
return (ret);
} /* int cf_dispatch */
return (ret);
} /* int cf_dispatch */
@@
-378,12
+378,12
@@
static int cf_ci_replace_child (oconfig_item_t *dst, oconfig_item_t *src,
temp = NULL;
/* If (src->children_num == 0) the array size is decreased. If offset
temp = NULL;
/* If (src->children_num == 0) the array size is decreased. If offset
- * is _not_ the last element, (offset < (
src
->children_num - 1)), then
+ * is _not_ the last element, (offset < (
dst
->children_num - 1)), then
* we need to move the trailing elements before resizing the array. */
* we need to move the trailing elements before resizing the array. */
- if ((src->children_num == 0) && (offset < (
src
->children_num - 1)))
+ if ((src->children_num == 0) && (offset < (
dst
->children_num - 1)))
{
{
- int nmemb =
src
->children_num - (offset + 1);
- memmove (
src->children + offset, src
->children + offset + 1,
+ int nmemb =
dst
->children_num - (offset + 1);
+ memmove (
dst->children + offset, dst
->children + offset + 1,
sizeof (oconfig_item_t) * nmemb);
}
sizeof (oconfig_item_t) * nmemb);
}
@@
-415,7
+415,7
@@
static int cf_ci_replace_child (oconfig_item_t *dst, oconfig_item_t *src,
sizeof (oconfig_item_t) * nmemb);
}
sizeof (oconfig_item_t) * nmemb);
}
- /* Last but not least: If there are new childre
m
, copy them to the
+ /* Last but not least: If there are new childre
n
, copy them to the
* memory reserved for them. */
if (src->children_num > 0)
{
* memory reserved for them. */
if (src->children_num > 0)
{
@@
-491,6
+491,9
@@
static int cf_include_all (oconfig_item_t *root, int depth)
/* Now replace the i'th child in `root' with `new'. */
cf_ci_replace_child (root, new, i);
/* Now replace the i'th child in `root' with `new'. */
cf_ci_replace_child (root, new, i);
+ /* ... and go back to the new i'th child. */
+ --i;
+
sfree (new->values);
sfree (new);
} /* for (i = 0; i < root->children_num; i++) */
sfree (new->values);
sfree (new);
} /* for (i = 0; i < root->children_num; i++) */