1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-27 16:50:58 +01:00

35482: be consistent about how argzero is allocated

This commit is contained in:
Barton E. Schaefer 2015-06-16 16:57:32 -07:00
parent 54c2c442ee
commit 19b37ef565
2 changed files with 7 additions and 2 deletions

View file

@ -1117,8 +1117,9 @@ setupshin(char *runscript)
exit(127);
}
scriptfilename = sfname;
zsfree(argzero); /* ztrdup'd in parseargs */
argzero = runscript;
sfname = argzero; /* copy to avoid race condition */
argzero = ztrdup(runscript);
zsfree(sfname); /* argzero ztrdup'd in parseargs */
}
/*
* We only initialise line numbering once there is a script to