Added support for %s (sysname) %m (machine) %r (release) and %v (version)

prompt macros to agree with getty(8).
This commit is contained in:
davidn 1997-02-02 07:33:50 +00:00
parent bd62efe166
commit 5c0afad0d2

View File

@ -39,6 +39,7 @@ static char sccsid[] = "@(#)utility.c 8.2 (Berkeley) 12/15/93";
#ifdef __FreeBSD__
#include <locale.h>
#include <sys/utsname.h>
#endif
#define PRINTOPTIONS
#include "telnetd.h"
@ -429,6 +430,12 @@ putf(cp, where)
#else
extern char *rindex();
#endif
#ifdef __FreeBSD__
static struct utsname kerninfo;
if (!*kerninfo.sysname)
uname(&kerninfo);
#endif
putlocation = where;
@ -465,6 +472,24 @@ putf(cp, where)
putstr(db);
break;
#ifdef __FreeBSD__
case 's':
putstr(kerninfo.sysname);
break;
case 'm':
putstr(kerninfo.machine);
break;
case 'r':
putstr(kerninfo.release);
break;
case 'v':
putstr(kerninfo.version);
break;
#endif
case '%':
putchr('%');
break;