Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Oct 1998 18:55:11 +1000 (EST)
From:      Stephen McKay <syssgm@dtir.qld.gov.au>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/8300: atq(1) ignores locale
Message-ID:  <199810130855.SAA26209@nymph.dtir.qld.gov.au>

next in thread | raw e-mail | index | archive | help

>Number:         8300
>Category:       bin
>Synopsis:       atq(1) ignores locale time info
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 13 02:00:01 PDT 1998
>Last-Modified:
>Originator:     Stephen McKay
>Organization:
none
>Release:        FreeBSD 3.0-CURRENT i386
>Environment:

Fairly recent -current.  Dual PPro 200.

>Description:

Only some parts of "at" pay attention to the locale.  In particular,
listing your queued jobs produces output in the much cursed and
completely incomprehensible US date format.  Your LANG variable
is ignored.

>How-To-Repeat:

$ at teatime oct 15
echo hello
Job 20 will be executed using /bin/sh
$ unset LANG
$ atq
Date                    Owner   Queue   Job#
16:00:00 10/15/98       root    c       20
$ LANG=en_GB.ISO_8859-1 atq
Date                    Owner   Queue   Job#
16:00:00 10/15/98       root    c       20
$

But after the patch ...

$ LANG=en_GB.ISO_8859-1 ./atq
Date                    Owner   Queue   Job#
16:00:00 15/10/98       root    c       20

Actually, I'd prefer:

Date                    Owner   Queue   Job#
1998-10-15 16:00:00     root    c       20

but that's different from just fixing a locale bug.  Maybe later.

I'll complain about the broken en_AU.ISO_8859-1 locale in a minute...

>Fix:

This patch works for me.  But do we want to just move the setlocale() call
that is already there?  Can that break anything?

I'm keen to commit this as it stands for 3.0.  Do I have approval?

Index: at.c
===================================================================
RCS file: /cvs/src/usr.bin/at/at.c,v
retrieving revision 1.13
diff -u -r1.13 at.c
--- at.c	1997/03/29 04:27:56	1.13
+++ at.c	1998/10/13 07:27:49
@@ -450,6 +450,10 @@
     time_t runtimer;
     char timestr[TIMESIZE];
     int first=1;
+    
+#ifdef __FreeBSD__
+    (void) setlocale(LC_TIME, "");
+#endif
 
     PRIV_START
 
Stephen.
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



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