On 5/13/24 11:32 PM, Matheus Afonso Martins Moreira wrote:
The patches touch the interface of many functions
I added one external function: find_in_path_var.
The other changes are all static and local.
It seems essentially equivalent to just calling
find_in_path (list->word->word, path_value ("BASH_SOURCE_PATH", 1),
FS_READABLE);
It is. I'm just very averse to chaining functions like that in C
since you can't write f(g(x)) without worrying about freeing
the value returned by g.
In this case, it's easy to look at other callers of path_value(), or at
path_value() itself (it's what, 8 lines?) to determine whether it returns
static memory -- which it does.
Anyway, there isn't any real reason to modify findcmd.c. Everything this
needs is already available.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/