mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 08:12:28 +00:00
Resolve argv[0] based on path search in ape-m1
This commit is contained in:
parent
1353db7d3f
commit
7bc20bff3e
2 changed files with 23 additions and 11 deletions
|
@ -123,6 +123,11 @@ static inline void GetProgramExecutableNameImpl(char *p, char *e) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// otherwise give up and just copy argv[0] into it
|
||||
if (!*p && __argv[0] && strlen(__argv[0]) < e - p) {
|
||||
strcpy(p, __argv[0]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue