freebsd-dev/lib/libc/gen/setprogname.c

20 lines
273 B
C
Raw Normal View History

2002-02-01 00:57:29 +00:00
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
2001-08-21 17:28:39 +00:00
#include <stdlib.h>
#include <string.h>
#include "libc_private.h"
void
setprogname(const char *progname)
{
2001-08-21 17:28:39 +00:00
const char *p;
p = strrchr(progname, '/');
if (p != NULL)
__progname = p + 1;
else
__progname = progname;
}