From 0997d762cfe3529fe472b599009b68f061841637 Mon Sep 17 00:00:00 2001 From: Steve Price Date: Thu, 7 Jan 1999 20:18:18 +0000 Subject: [PATCH] Strip the leading path from __progname. Ok'd by: jdp --- lib/csu/alpha/crt1.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/csu/alpha/crt1.c b/lib/csu/alpha/crt1.c index 2f7fd95a91b8..5a022852d403 100644 --- a/lib/csu/alpha/crt1.c +++ b/lib/csu/alpha/crt1.c @@ -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.1.1.2 1998/03/11 20:36:09 jb Exp $ + * $Id: crt1.c,v 1.2 1998/08/20 21:37:22 jb Exp $ */ #ifndef __GNUC__ @@ -80,8 +80,12 @@ _start(char **ap, 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))