mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 03:08:31 +00:00
parent
e961385e55
commit
d71da7fc72
13 changed files with 71 additions and 40 deletions
|
@ -136,10 +136,11 @@ static inline void InitProgramExecutableNameImpl(void) {
|
|||
}
|
||||
|
||||
// give up and just copy argv[0] into it
|
||||
char *p, *e;
|
||||
if ((q = __argv[0])) {
|
||||
CopyString:
|
||||
char *p = g_prog.u.buf;
|
||||
char *e = p + sizeof(g_prog.u.buf);
|
||||
p = g_prog.u.buf;
|
||||
e = p + sizeof(g_prog.u.buf);
|
||||
while ((c = *q++)) {
|
||||
if (p + 1 < e) {
|
||||
*p++ = c;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue