Changeset View
Changeset View
Standalone View
Standalone View
contrib/blacklist/port/getprogname.c
- This file was added.
Property | Old Value | New Value |
---|---|---|
svn:eol-style | null | native \ No newline at end of property |
svn:keywords | null | FreeBSD=%H \ No newline at end of property |
svn:mime-type | null | text/plain \ No newline at end of property |
#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; | |||||
} |