Re: [PATCH v2 6/8] builtins/source: use source path in isolated mode

2024-05-15 Thread Koichi Murase
2024年5月15日(水) 22:28 Chet Ramey : > On 5/14/24 5:26 PM, Koichi Murase wrote: > > I see. I was assuming that users who want to completely turn off the > > new feature would set an empty BASH_SOURCE_PATH (for both cases > > `source name' and `source -i name'). > > If you don't want to use BASH_SOURCE_

Re: [PATCH v2 6/8] builtins/source: use source path in isolated mode

2024-05-15 Thread Chet Ramey
On 5/14/24 5:26 PM, Koichi Murase wrote: I see. I was assuming that users who want to completely turn off the new feature would set an empty BASH_SOURCE_PATH (for both cases `source name' and `source -i name'). If you don't want to use BASH_SOURCE_PATH, don't set BASH_SOURCE_PATH, and unset it

Re: [PATCH v2 6/8] builtins/source: use source path in isolated mode

2024-05-14 Thread Koichi Murase
2024年5月15日(水) 5:16 Chet Ramey : > On 5/13/24 10:53 PM, Matheus Afonso Martins Moreira wrote: > >> I think we should restrict the search in > >> BASH_SOURCE_PATH and shouldn't fall back to local files. > > > > I concur but thought it'd be wise to discuss it first so I left it in. > > Searching the c

Re: [PATCH v2 6/8] builtins/source: use source path in isolated mode

2024-05-14 Thread Koichi Murase
2024年5月15日(水) 5:02 Chet Ramey : > > In that case, > > we need to make sure that `find_in_path_var()' returns NULL in the > > case of empty BASH_SOURCE_PATH. > > Do you mean BASH_SOURCE_PATH= ? Yes. Or more precisely, I intended to include both `BASH_SOURCE_PATH=' and `unset -v BASH_SOURCE_PATH'.

Re: [PATCH v2 6/8] builtins/source: use source path in isolated mode

2024-05-14 Thread Chet Ramey
On 5/13/24 10:53 PM, Matheus Afonso Martins Moreira wrote: I think we should restrict the search in BASH_SOURCE_PATH and shouldn't fall back to local files. I concur but thought it'd be wise to discuss it first so I left it in. Searching the current directory is the existing behavior (albeit

Re: [PATCH v2 6/8] builtins/source: use source path in isolated mode

2024-05-14 Thread Chet Ramey
On 5/13/24 7:39 PM, Koichi Murase wrote: * With this, `isolated_search_for_file()' falls back to local files in the current working directory. I'm unsure about whether this is intentional, but I think we should restrict the search in BASH_SOURCE_PATH and shouldn't fall back to local files. You

Re: Re: [PATCH v2 6/8] builtins/source: use source path in isolated mode

2024-05-13 Thread Matheus Afonso Martins Moreira
> I think we should restrict the search in > BASH_SOURCE_PATH and shouldn't fall back to local files. I concur but thought it'd be wise to discuss it first so I left it in. Users might expect it to respect the configuration option. I also saw that many of the PATH-like variable defaults had the cu

Re: [PATCH v2 6/8] builtins/source: use source path in isolated mode

2024-05-13 Thread Koichi Murase
2024年5月13日(月) 19:40 Matheus Afonso Martins Moreira : > diff --git a/builtins/source.def b/builtins/source.def > index 26040e70..7f870bfe 100644 > --- a/builtins/source.def > +++ b/builtins/source.def > @@ -177,6 +178,27 @@ search_for_file (WORD_LIST *list) > [...] > +static char * > +isolated_searc

[PATCH v2 6/8] builtins/source: use source path in isolated mode

2024-05-13 Thread Matheus Afonso Martins Moreira
Behave normally when executed without any options. Search only BASH_SOURCE_PATH for scripts to source when isolated mode is enabled via the -i option. Signed-off-by: Matheus Afonso Martins Moreira --- builtins/source.def | 27 ++- 1 file changed, 26 insertions(+), 1 delet