jow- / ucode

JavaScript-like language with optional templating
ISC License
87 stars 24 forks source link

uci: fix ctx.commit() without arguments #148

Closed jow- closed 1 year ago

jow- commented 1 year ago

A uci commit operation may invalidate the package pointer, leading to an infinite loop while iterating the packages to commit.

Refactor the code to first build a string list of configurations, then iterating it in order to avoid the iterator invalidation.

While we're at it, also allow restricting save and revert operations to single configs, which was rejected as invalid before.

Fixes: #146