diff options
author | steve <steve@FreeBSD.org> | 1999-01-07 20:18:18 +0000 |
---|---|---|
committer | steve <steve@FreeBSD.org> | 1999-01-07 20:18:18 +0000 |
commit | 1e08e3b3da64c8d8c70093eec85482acd50625df (patch) | |
tree | af82f413df22c6f68b6371e13d3f8c3c10092710 /lib/csu | |
parent | 4a500ef9654224aaffe58c748a45cf6da0daf44e (diff) | |
download | FreeBSD-src-1e08e3b3da64c8d8c70093eec85482acd50625df.zip FreeBSD-src-1e08e3b3da64c8d8c70093eec85482acd50625df.tar.gz |
Strip the leading path from __progname.
Ok'd by: jdp
Diffstat (limited to 'lib/csu')
-rw-r--r-- | lib/csu/alpha/crt1.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/csu/alpha/crt1.c b/lib/csu/alpha/crt1.c index 2f7fd95..5a02285 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)) |