On Sat, Jun 1, 2024 at 7:16 PM Koichi Murase <myoga.mur...@gmail.com> wrote:
>
> ---
>  variables.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/variables.c b/variables.c
> index 84b30d93..0e785742 100644
> --- a/variables.c
> +++ b/variables.c
> @@ -3507,7 +3507,11 @@ bind_function_def (const char *name, FUNCTION_DEF 
> *value, int flags)
>    if (entry && (flags & 1))
>      {
>        dispose_function_def_contents (entry);
> +
> +      cmd = value->command;
> +      value->command = 0;
>        entry = copy_function_def_contents (value, entry);
> +      value->command = cmd;
>      }
>    else if (entry)
>      return;
> --
> 2.45.0
>

Hello,

I haven't looked at this but it will keep lazy functions safe to
implement right?

Lazy functions are functions that redefine themselves the first time
they are called.  For example they can call a script containing the
proper implementation with heavier code.  Or simplify themselves
depending on the environment or the available tools they detect at
first run.


-- 
konsolebox

Reply via email to