From 45fa48fe14de46c359fa17ce714291756474f86d Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Tue, 7 May 1996 19:05:10 +0000 Subject: [PATCH] Localize time --- eBones/libexec/telnetd/utility.c | 10 ++++++++++ secure/libexec/telnetd/utility.c | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/eBones/libexec/telnetd/utility.c b/eBones/libexec/telnetd/utility.c index 049fcd137d26..e2f285aa1c59 100644 --- a/eBones/libexec/telnetd/utility.c +++ b/eBones/libexec/telnetd/utility.c @@ -35,6 +35,9 @@ static char sccsid[] = "@(#)utility.c 8.4 (Berkeley) 5/30/95"; #endif /* not lint */ +#ifdef __FreeBSD__ +#include +#endif #define PRINTOPTIONS #include "telnetd.h" @@ -433,12 +436,16 @@ putchr(cc) *putlocation++ = cc; } +#ifdef __FreeBSD__ +static char fmtstr[] = { "%+" }; +#else /* * This is split on two lines so that SCCS will not see the M * between two % signs and expand it... */ static char fmtstr[] = { "%l:%M\ %P on %A, %d %B %Y" }; +#endif void putf(cp, where) @@ -481,6 +488,9 @@ putf(cp, where) break; case 'd': +#ifdef __FreeBSD__ + setlocale(LC_TIME, ""); +#endif (void)time(&t); (void)strftime(db, sizeof(db), fmtstr, localtime(&t)); putstr(db); diff --git a/secure/libexec/telnetd/utility.c b/secure/libexec/telnetd/utility.c index 049fcd137d26..e2f285aa1c59 100644 --- a/secure/libexec/telnetd/utility.c +++ b/secure/libexec/telnetd/utility.c @@ -35,6 +35,9 @@ static char sccsid[] = "@(#)utility.c 8.4 (Berkeley) 5/30/95"; #endif /* not lint */ +#ifdef __FreeBSD__ +#include +#endif #define PRINTOPTIONS #include "telnetd.h" @@ -433,12 +436,16 @@ putchr(cc) *putlocation++ = cc; } +#ifdef __FreeBSD__ +static char fmtstr[] = { "%+" }; +#else /* * This is split on two lines so that SCCS will not see the M * between two % signs and expand it... */ static char fmtstr[] = { "%l:%M\ %P on %A, %d %B %Y" }; +#endif void putf(cp, where) @@ -481,6 +488,9 @@ putf(cp, where) break; case 'd': +#ifdef __FreeBSD__ + setlocale(LC_TIME, ""); +#endif (void)time(&t); (void)strftime(db, sizeof(db), fmtstr, localtime(&t)); putstr(db);