2024年5月13日(月) 19:38 Matheus Afonso Martins Moreira
<matheus.a.m.more...@gmail.com>:
> The PATH variable is hard coded in the user command finder function.
> Transforming it into an argument allows reusing the file finding logic
> with variables other than PATH, making the code more flexible.

I think what was suggested by Chet is to confine the changes in
builtins/source.def. The patches touch the interface of many
functions, but it seems essentially equivalent to just calling

  find_in_path (list->word->word, path_value ("BASH_SOURCE_PATH", 1),
FS_READABLE);

The cases where path_value() returns NULL or an empty string would be
anyway handled by find_in_path() [more specifically by
_find_user_command_internal() and find_user_command_in_path() called
by find_in_path()]. I doubt it's worth adding those changes in
`findcmd.c'. So are the changes in [PATCH v2 2/8].

Reply via email to