diff options
author | Steve Price <steve@FreeBSD.org> | 1999-01-07 20:18:18 +0000 |
---|---|---|
committer | Steve Price <steve@FreeBSD.org> | 1999-01-07 20:18:18 +0000 |
commit | 0997d762cfe3529fe472b599009b68f061841637 (patch) | |
tree | 88c788b76192da814d30d2bfcd365189e761e7fb /lib | |
parent | 740e54be27af8df71fcbee86170c188825afbcd4 (diff) | |
download | src-0997d762cfe3529fe472b599009b68f061841637.tar.gz src-0997d762cfe3529fe472b599009b68f061841637.zip |
Strip the leading path from __progname.
Ok'd by: jdp
Notes
Notes:
svn path=/head/; revision=42376
Diffstat (limited to 'lib')
-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 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)) |