Merge from vendor branch BZIP:
[dragonfly.git] / lib / libc / gen / setprogname.c
CommitLineData
1de703da
MD
1/*
2 * $FreeBSD: src/lib/libc/gen/setprogname.c,v 1.1.2.4 2002/02/11 01:18:35 dd Exp $
3 * $DragonFly: src/lib/libc/gen/setprogname.c,v 1.2 2003/06/17 04:26:42 dillon Exp $
4 */
984263bc
MD
5
6#include <stdlib.h>
7#include <string.h>
8
9extern const char *__progname;
10
11void
12setprogname(const char *progname)
13{
14 const char *p;
15
16 p = strrchr(progname, '/');
17 if (p != NULL)
18 __progname = p + 1;
19 else
20 __progname = progname;
21}