From 9e6c3bb431e80d51fddd8cf4dcb6a13ac39c8713 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sat, 20 Jun 2026 15:17:15 +0100 Subject: [PATCH] core: foreach-object: update variable definition api usage --- bshell.core/cmdlets/foreach-object.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bshell.core/cmdlets/foreach-object.c b/bshell.core/cmdlets/foreach-object.c index e979eec..4801eb4 100644 --- a/bshell.core/cmdlets/foreach-object.c +++ b/bshell.core/cmdlets/foreach-object.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -51,7 +52,9 @@ static enum bshell_status process_record( } bshell_runtime_push_scope(rt, p->f_block); - bshell_variable *item = bshell_runtime_define_var(rt, "_"); + bshell_variable *item = bshell_runtime_scope_define_variable( + bshell_runtime_get_current_scope(rt), + "_"); bshell_variable_set_value(item, in); fx_value out = bshell_runtime_eval(rt); bshell_runtime_pop_scope(rt);