mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-06 01:40:28 +00:00
Save a scan of ps->name
This commit is contained in:
parent
a13ea13b19
commit
e7d3dc3aa7
1 changed files with 2 additions and 2 deletions
|
@ -371,8 +371,8 @@ static char FindCommand(struct PathSearcher *ps) {
|
|||
static char *Commandv(struct PathSearcher *ps, const char *name,
|
||||
const char *syspath) {
|
||||
ps->syspath = syspath ? syspath : "/bin:/usr/local/bin:/usr/bin";
|
||||
if (!(ps->namelen = StrLen((ps->name = name)))) return 0;
|
||||
if (ps->indirect) ps->namelen -= 4;
|
||||
ps->name = name;
|
||||
if (!(ps->namelen = ps->indirect ? ps->indirect : StrLen(ps->name))) return 0;
|
||||
if (ps->namelen + 1 > sizeof(ps->path)) return 0;
|
||||
if (FindCommand(ps)) {
|
||||
return ps->path;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue