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