1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-29 08:08:37 +00:00

Old stuff from a source tree: copy (verbatum) the code to expand the

%s/%m in the default /etc/gettytab.
This commit is contained in:
Peter Wemm 1998-12-16 06:01:33 +00:00
parent c399ed564c
commit 3f0340f838
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=41856
2 changed files with 62 additions and 4 deletions

View File

@ -36,11 +36,12 @@
static const char sccsid[] = "@(#)utility.c 8.4 (Berkeley) 5/30/95";
#endif
static const char rcsid[] =
"$Id$";
"$Id: utility.c,v 1.3 1998/02/16 12:09:28 markm Exp $";
#endif /* not lint */
#ifdef __FreeBSD__
#include <locale.h>
#include <sys/utsname.h>
#endif
#define PRINTOPTIONS
#include "telnetd.h"
@ -471,11 +472,21 @@ putf(cp, where)
#else
extern char *strrchr();
#endif
#ifdef __FreeBSD__
static struct utsname kerninfo;
if (!*kerninfo.sysname)
uname(&kerninfo);
#endif
putlocation = where;
while (*cp) {
if (*cp != '%') {
if (*cp =='\n') {
putstr("\r\n");
cp++;
continue;
} else if (*cp != '%') {
putchr(*cp++);
continue;
}
@ -507,6 +518,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;

View File

@ -36,11 +36,12 @@
static const char sccsid[] = "@(#)utility.c 8.4 (Berkeley) 5/30/95";
#endif
static const char rcsid[] =
"$Id$";
"$Id: utility.c,v 1.3 1998/02/16 12:09:28 markm Exp $";
#endif /* not lint */
#ifdef __FreeBSD__
#include <locale.h>
#include <sys/utsname.h>
#endif
#define PRINTOPTIONS
#include "telnetd.h"
@ -471,11 +472,21 @@ putf(cp, where)
#else
extern char *strrchr();
#endif
#ifdef __FreeBSD__
static struct utsname kerninfo;
if (!*kerninfo.sysname)
uname(&kerninfo);
#endif
putlocation = where;
while (*cp) {
if (*cp != '%') {
if (*cp =='\n') {
putstr("\r\n");
cp++;
continue;
} else if (*cp != '%') {
putchr(*cp++);
continue;
}
@ -507,6 +518,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;