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

prompt macros to agree with getty(8).
This commit is contained in:
David Nugent 1997-02-02 07:33:50 +00:00
parent 5e176f9a97
commit 54472d02d2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=22196

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;