use getprogname if we have, otherwise punt, remove roken dependency
This commit is contained in:
@@ -53,8 +53,11 @@ mandoc_template(SL_cmd *cmds,
|
|||||||
t = time(NULL);
|
t = time(NULL);
|
||||||
strftime(timestr, sizeof(timestr), "%b %d, %Y", localtime(&t));
|
strftime(timestr, sizeof(timestr), "%b %d, %Y", localtime(&t));
|
||||||
printf(".Dd %s\n", timestr);
|
printf(".Dd %s\n", timestr);
|
||||||
p = strrchr(getprogname(), '/');
|
#ifdef HAVE_GETPROGNAME
|
||||||
if(p) p++; else p = getprogname();
|
p = getprogname();
|
||||||
|
#else
|
||||||
|
p = "unknown-application";
|
||||||
|
#endif
|
||||||
strncpy(cmd, p, sizeof(cmd));
|
strncpy(cmd, p, sizeof(cmd));
|
||||||
cmd[sizeof(cmd)-1] = '\0';
|
cmd[sizeof(cmd)-1] = '\0';
|
||||||
strupr(cmd);
|
strupr(cmd);
|
||||||
|
Reference in New Issue
Block a user