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

22 lines
350 B
C
Raw Normal View History

#if defined(LIBC_RCS) && !defined(lint)
static const char rcsid[] =
"$FreeBSD$";
#endif /* LIBC_RCS and not lint */
2001-08-21 17:28:39 +00:00
#include <stdlib.h>
#include <string.h>
extern const char *__progname;
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;
}