mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-16 07:11:05 +01:00
Initialize __progname by argv[0] before striping leading path,
otherwise we always get empty name.
This commit is contained in:
parent
dd81f3b0a0
commit
49837d6cd0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=42826
@ -30,7 +30,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: crt1.c,v 1.2 1998/08/20 21:37:22 jb Exp $
|
||||
* $Id: crt1.c,v 1.3 1999/01/07 20:18:18 steve Exp $
|
||||
*/
|
||||
|
||||
#ifndef __GNUC__
|
||||
@ -82,6 +82,7 @@ _start(char **ap,
|
||||
environ = env;
|
||||
if(argc > 0 && argv[0] != NULL) {
|
||||
char *s;
|
||||
__progname = argv[0];
|
||||
for (s = __progname; *s != '\0'; s++)
|
||||
if (*s == '/')
|
||||
__progname = s + 1;
|
||||
|
Loading…
Reference in New Issue
Block a user