]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - lib/libc/gen/setprogname.c
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / lib / libc / gen / setprogname.c
1 #include <sys/cdefs.h>
2 __FBSDID("$FreeBSD$");
3
4 #include <stdlib.h>
5 #include <string.h>
6
7 #include "libc_private.h"
8
9 void
10 setprogname(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 }