mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-06-25 13:25:39 +03:00
Do not fail on partial ctl path for ctl_nametomib()
We do not fail on partial ctl path when the given `mib` array is shorter than the given name, and we should keep the behavior the same in the reverse case, which I feel is also the more natural way.
This commit is contained in:
parent
6ab181d2b7
commit
f2e1a5be77
2 changed files with 17 additions and 6 deletions
|
|
@ -1387,7 +1387,8 @@ ctl_lookup(tsdn_t *tsdn, const ctl_named_node_t *starting_node,
|
|||
mibp[i] = (size_t)index;
|
||||
}
|
||||
|
||||
if (node->ctl != NULL) {
|
||||
/* Reached the end? */
|
||||
if (node->ctl != NULL || *dot == '\0') {
|
||||
/* Terminal node. */
|
||||
if (*dot != '\0') {
|
||||
/*
|
||||
|
|
@ -1403,11 +1404,6 @@ ctl_lookup(tsdn_t *tsdn, const ctl_named_node_t *starting_node,
|
|||
}
|
||||
|
||||
/* Update elm. */
|
||||
if (*dot == '\0') {
|
||||
/* No more elements. */
|
||||
ret = ENOENT;
|
||||
goto label_return;
|
||||
}
|
||||
elm = &dot[1];
|
||||
dot = ((tdot = strchr(elm, '.')) != NULL) ? tdot :
|
||||
strchr(elm, '\0');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue