Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Jan 1999 13:21:29 -0600 (CST)
From:      Steve Price <sprice@hiwaay.net>
To:        freebsd-alpha@FreeBSD.ORG
Cc:        cejkar@dcse.fee.vutbr.cz
Subject:   strip path from __progname
Message-ID:  <Pine.OSF.4.02.9901071318020.13152-100000@fly.HiWAAY.net>
In-Reply-To: <199901071848.TAA27000@kazi.dcse.fee.vutbr.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi All,

Does anyone have a problem with me committing the attached
patch to fixup FreeBSD-Alpha like the i386-{elf|aout} side
of the house wrt to stripping the path from __progname?

Thanks, Steve

Index: crt1.c
===================================================================
RCS file: /home/ncvs/src/lib/csu/alpha/crt1.c,v
retrieving revision 1.2
diff -u -r1.2 crt1.c
--- crt1.c	1998/08/20 21:37:22	1.2
+++ crt1.c	1999/01/07 19:17:16
@@ -80,8 +80,12 @@
 	argv = ap + 1;
 	env  = ap + 2 + argc;
 	environ = env;
-	if(argc > 0)
-		__progname = argv[0];
+	if(argc > 0 && argv[0] != NULL) {
+		char *s;
+		for (s = __progname; *s != '\0'; s++)
+			if (*s == '/')
+				__progname = s + 1;
+	}
 
 	if (&_DYNAMIC != NULL) {
 		if ((obj == NULL) || (obj->magic != RTLD_MAGIC))


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.OSF.4.02.9901071318020.13152-100000>