bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/8] findcmd: parameterize path variable in functions


From: Koichi Murase
Subject: Re: [PATCH v2 1/8] findcmd: parameterize path variable in functions
Date: Tue, 14 May 2024 08:47:13 +0900

2024年5月13日(月) 19:38 Matheus Afonso Martins Moreira
<matheus.a.m.moreira@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

[Prev in Thread] Current Thread [Next in Thread]