[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 6/8] builtins/source: use source path in isolated mode
From: |
Koichi Murase |
Subject: |
Re: [PATCH v2 6/8] builtins/source: use source path in isolated mode |
Date: |
Wed, 15 May 2024 06:26:51 +0900 |
2024年5月15日(水) 5:02 Chet Ramey <chet.ramey@case.edu>:
> > 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'.
> That's the standard behavior of PATH-like
> variables: a null element anywhere is equivalent to `.'. Does this
> require a special case?
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'). Suppose we consider, for `source
name', 1) BASH_SOURCE_PATH, 2) PATH, and 3) the current directory in
order (which is actually different from the submitted patch). If we
are to use `find_in_path_var' or `find_in_path' for step 1, we can
return NULL to fall back to step 2 (or otherwise step 2 would be
skipped with a naive implementation).
However, thinking about it again, maybe `unset -v BASH_SOURCE_PATH'
would mean skipping step 1, and `BASH_SOURCE_PATH=' could just mean
the current working directory skipping steps 1 and 2.
- Re: [PATCH v2 5/8] builtins/source: parse the -i option, (continued)
[PATCH v2 6/8] builtins/source: use source path in isolated mode, Matheus Afonso Martins Moreira, 2024/05/13
Re: [PATCH v2 6/8] builtins/source: use source path in isolated mode, Chet Ramey, 2024/05/14
Re: [PATCH v2 6/8] builtins/source: use source path in isolated mode,
Koichi Murase <=
Re: [PATCH v2 6/8] builtins/source: use source path in isolated mode, Chet Ramey, 2024/05/15
Re: [PATCH v2 6/8] builtins/source: use source path in isolated mode, Koichi Murase, 2024/05/15
[PATCH v2 7/8] variables: define default BASH_SOURCE_PATH, Matheus Afonso Martins Moreira, 2024/05/13
[PATCH v2 8/8] shell: restrict BASH_SOURCE_PATH when appropriate, Matheus Afonso Martins Moreira, 2024/05/13