netbsd/external/bsd/blacklist/port/getprogname.c
2015-10-15 10:25:28 +02:00

25 lines
297 B
C

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
extern char *__progname;
const char *
getprogname(void)
{
return __progname;
}
void
setprogname(char *p)
{
char *q;
if (p == NULL)
return;
if ((q = strrchr(p, '/')) != NULL)
__progname = ++q;
else
__progname = p;
}