2024年5月15日(水) 5:02 Chet Ramey <chet.ra...@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.