git: w(1): Limit affect of locale change

John Marino marino at crater.dragonflybsd.org
Tue Dec 8 13:52:16 PST 2015


commit ef2687d455a182ac4297be77c0432959bc6e1127
Author: John Marino <draco at marino.st>
Date:   Tue Dec 8 22:40:03 2015 +0100

    w(1): Limit affect of locale change
    
    In essence, w(1) is not designed to be locale sensitive.  The majority
    of the outputted text is exclusively English.  However, it does check
    the locale for the AM/PM setting (12 hour vs 24 hour clock) and the
    decimal separator.
    
    Given that w(1) is designed for English, it only provides enough space
    to accommodate "AM" or "PM".  When other locales are used
    (e.g. de_DE.UTF-8) the output is simply truncated and confusing.
    
    Let's keep the 12-hour clock labels in the same language as the rest
    of the program by forcing strftime to use the C/POSIX locale.  Using
    locales still affects am/pm presence and the decimal separator as
    originally intended.

Summary of changes:
 usr.bin/w/pr_time.c | 2 +-
 usr.bin/w/w.c       | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/ef2687d455a182ac4297be77c0432959bc6e1127


-- 
DragonFly BSD source repository


More information about the Commits mailing list