mirror of
https://github.com/sheumann/telnetd.git
synced 2025-02-19 18:30:30 +00:00
Old stuff from a source tree: copy (verbatum) the code to expand the
%s/%m in the default /etc/gettytab. git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@41856 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
This commit is contained in:
parent
5abbe24d1c
commit
a2726b72a6
@ -36,11 +36,12 @@
|
|||||||
static const char sccsid[] = "@(#)utility.c 8.4 (Berkeley) 5/30/95";
|
static const char sccsid[] = "@(#)utility.c 8.4 (Berkeley) 5/30/95";
|
||||||
#endif
|
#endif
|
||||||
static const char rcsid[] =
|
static const char rcsid[] =
|
||||||
"$Id$";
|
"$Id: utility.c,v 1.3 1998/02/16 12:09:28 markm Exp $";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
#include <sys/utsname.h>
|
||||||
#endif
|
#endif
|
||||||
#define PRINTOPTIONS
|
#define PRINTOPTIONS
|
||||||
#include "telnetd.h"
|
#include "telnetd.h"
|
||||||
@ -471,11 +472,21 @@ putf(cp, where)
|
|||||||
#else
|
#else
|
||||||
extern char *strrchr();
|
extern char *strrchr();
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
static struct utsname kerninfo;
|
||||||
|
|
||||||
|
if (!*kerninfo.sysname)
|
||||||
|
uname(&kerninfo);
|
||||||
|
#endif
|
||||||
|
|
||||||
putlocation = where;
|
putlocation = where;
|
||||||
|
|
||||||
while (*cp) {
|
while (*cp) {
|
||||||
if (*cp != '%') {
|
if (*cp =='\n') {
|
||||||
|
putstr("\r\n");
|
||||||
|
cp++;
|
||||||
|
continue;
|
||||||
|
} else if (*cp != '%') {
|
||||||
putchr(*cp++);
|
putchr(*cp++);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -507,6 +518,24 @@ putf(cp, where)
|
|||||||
putstr(db);
|
putstr(db);
|
||||||
break;
|
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 '%':
|
case '%':
|
||||||
putchr('%');
|
putchr('%');
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user