diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-11-23 12:48:07 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-11-23 13:19:11 +0100 |
commit | d2cc00310dba05de233ff18d3c830c8638f9bfdf (patch) | |
tree | 5fd5fc6734da0bacad08df7092dd6c6fa6701716 /.github | |
parent | fdc9b6a3841d7346dab6f4aeea06322be0d3ee95 (diff) |
uci: auto-load package in `ctx.foreach()` and `ctx.get_first()`
Functions that use `uci_lookup_ptr()` internally, such as `ctx.get()`,
`ctx.set()` or `ctx.delete()`, implicitly load the given configuration
name while the higher level functions `ctx.foreach()` or `ctx.get_first()`
do not.
This behaviour violates the principle of least surprise and might lead to
non-deterministic program behavior as the outcome of these functions
depends on prior uci operations performed on the cursor.
Fix this issue by invoking `uci_load()` internally in case the given
uci package name cannot be found in the cursor's package cache.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to '.github')
0 files changed, 0 insertions, 0 deletions