setprogname.c (ccbe835258a2ecc26c1dc7fd5e474c40413bc253) setprogname.c (ea8d448a923f0d68d7ecf1d2a0583c7d17bdee4e)
1#if defined(LIBC_RCS) && !defined(lint)
2static const char rcsid[] =
3 "$FreeBSD$";
4#endif /* LIBC_RCS and not lint */
1#include <sys/cdefs.h>
2__FBSDID("$FreeBSD$");
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}
3
4#include <stdlib.h>
5#include <string.h>
6
7extern const char *__progname;
8
9void
10setprogname(const char *progname)
11{
12 const char *p;
13
14 p = strrchr(progname, '/');
15 if (p != NULL)
16 __progname = p + 1;
17 else
18 __progname = progname;
19}