Resolve argv[0] based on path search in ape-m1

This commit is contained in:
Justine Tunney 2023-06-16 16:58:30 -07:00
parent 1353db7d3f
commit 7bc20bff3e
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
2 changed files with 23 additions and 11 deletions

View file

@ -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]);
}
}
/**