Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Mar 1997 14:07:03 +0900 (KST)
From:      Choi Jun Ho <choi.junho@jazz.snu.ac.kr>
To:        freebsd-hackers@freebsd.org
Subject:   who(1) is too simple?
Message-ID:  <199703260507.OAA11540@jazz.snu.ac.kr>

next in thread | raw e-mail | index | archive | help
I just tried to define LC_TIME for our language, but it seems to
to have some problem... see this.

moderato:~% env LANG=en_US.ISO_8859-1 who
junker   ttyp0   Mar 26 11:25   (jazz)
junker   ttyp1   Mar 26 11:45   (jazz)
moderato:~% env LANG=fr_FR.ISO_8859-1 who
junker   ttyp0   26 mar 11:25   (jazz)
junker   ttyp1   26 mar 11:45   (jazz)

They all have in LC_TIME definition:

#
# c_fmt
#
%a %e %b %X %Y

and who(1) use strftime(3) to show date and time.
but, LC_TIME of ko_KR.EUC define as follows:

#
# c_fmt
#
$)C
%Y3b %b %e@O %a?d@O %X
(year) (month) (day) (weekday) (time)

but, in the source of who.c:

        (void)strftime(buf, sizeof(buf), "%c", localtime(&up->ut_time));
        buf[sizeof(buf) - 1] = '\0';
        (void)printf("%.12s", buf + 4);

it just skip 'weekdays'(buf+4) and display only 12 chars!
(month(4)+day(3)+time(5)). it is not i18ned.

So, when I run who(1) in ko_KR.EUC:

moderato:~% who
junker   ttyp0   3b  3?y 26@O   (jazz)
(it doesn't display year, not time, only show month and day)

I think there must be the change to use LC_TIME correctly...
patching seems to be somewhat difficult, because when we must extract
only information about weekend, month, day and time only if we must
maintain display format compatibility, and it is not specified in 
LC_TIME, so it is very difficult to make balance according to each locale.

How do you think about that? we must maintain compatability of 
display format of who(1)? (of course, some commercial UNIX do this...
like Solaris  or OSF/1) if not, how about considering using just
c_fmt fully...
output may like... 
junker   ttyp0   Wed Mar 26 14:11:40 1997  (jazz)
(hmm.. something strange?)

-- 
--------------------------------------------------------------^^---
Judgement Uninfected Naked Kind & Executive Ranger    - J U N K E R
                             from KONAMI 1990 "SD-Snatcher" in MSX2
Choi Jun Ho <junker@jazz.snu.ac.kr>   http://jazz.snu.ac.kr/~junker
Distributed Computing System Lab,   CS Dept.,  Seoul National Univ.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703260507.OAA11540>