Searchpath searches for the executable
name in the same way that
The environment variable
$PATH is treated as a colon-separated list of directories in which to look for
name. An empty string in the list is treated as the current directory.
If an executable named
name is found in one of the directories,
searchpath returns a pointer to a malloced string containing a path
(dir/name, or simply
name) suitable for use in
name begins with
../ , or
/ , then the search path is ignored.
name exists and is an executable, then
searchpath returns a malloced string containing name.
The returned buffer should be freed when no longer needed.
name is not found,
searchpath returns nil.