[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/4] findcmd: define the user import finder function
From: |
Lawrence Velázquez |
Subject: |
Re: [PATCH 3/4] findcmd: define the user import finder function |
Date: |
Thu, 02 May 2024 21:37:24 -0400 |
User-agent: |
Cyrus-JMAP/3.11.0-alpha0-417-gddc99d37d-fm-hotfix-20240424.001-g2c179674 |
On Thu, May 2, 2024, at 6:22 PM, Matheus Afonso Martins Moreira wrote:
> The find_user_import function looks for executable scripts
> in a separate location meant for reusable libraries and modules,
> separate from other executables.
>
> Signed-off-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
> ---
> findcmd.c | 12 ++++++++++++
> findcmd.h | 1 +
> 2 files changed, 13 insertions(+)
>
> diff --git a/findcmd.c b/findcmd.c
> index cef342e0..6ad62c73 100644
> --- a/findcmd.c
> +++ b/findcmd.c
> @@ -244,6 +244,18 @@ find_user_command (name)
> return (find_user_command_internal (name, "PATH",
> FS_EXEC_PREFERRED|FS_NODIRS));
> }
>
> +/* Locate the executable file referenced by NAME, searching along
> + the contents of the shell BASH_IMPORT_PATH variable.
> + Return a new string which is the full pathname to the file,
> + or NULL if the file couldn't be found.
> + Only executables can be found. */
Why does this only find executable files? Files don't have to be
executable to be sourced. Executable scripts tend to be unsuitable
for sourcing anyway because they assume that they will be run in
their own shell process.
--
vq
- [PATCH 0/4] Add import builtin, Matheus Afonso Martins Moreira, 2024/05/02
- [PATCH 1/4] builtins: extract file content executor function, Matheus Afonso Martins Moreira, 2024/05/02
- [PATCH 3/4] findcmd: define the user import finder function, Matheus Afonso Martins Moreira, 2024/05/02
- Re: [PATCH 3/4] findcmd: define the user import finder function,
Lawrence Velázquez <=
- [PATCH 4/4] builtins: add import builtin, Matheus Afonso Martins Moreira, 2024/05/02
- [PATCH 2/4] findcmd: parameterize path variable in functions, Matheus Afonso Martins Moreira, 2024/05/02
- Re: [PATCH 0/4] Add import builtin, Dale R. Worley, 2024/05/02
- Re: [PATCH 0/4] Add import builtin, Lawrence Velázquez, 2024/05/02