From 8aa15b2be2bd2ab4b76d197a279abf8b9091680a Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Mon, 28 Sep 2009 17:32:15 +0100 Subject: ls: use the POSIX date style when the locale does not specify one Previously we defaulted to "long-iso" format in locales without specific format translations, like the en_* locales for example. This reverts part of commit 6837183d, 08-11-2005, "ls ... acts like --time-style='posix-long-iso' if the locale settings are messed up" * src/ls.c (decode_switches): Only use the ISO format when specified. * NEWS: Mention the change in behavior. Reported by Daniel Qarras at http://bugzilla.redhat.com/525134 --- src/ls.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/ls.c') diff --git a/src/ls.c b/src/ls.c index ff0ad2144..6e3e836cb 100644 --- a/src/ls.c +++ b/src/ls.c @@ -2032,7 +2032,6 @@ decode_switches (int argc, char **argv) break; case long_iso_time_style: - case_long_iso_time_style: long_time_format[0] = long_time_format[1] = "%Y-%m-%d %H:%M"; break; @@ -2044,17 +2043,10 @@ decode_switches (int argc, char **argv) case locale_time_style: if (hard_locale (LC_TIME)) { - /* Ensure that the locale has translations for both - formats. If not, fall back on long-iso format. */ int i; for (i = 0; i < 2; i++) - { - char const *locale_format = - dcgettext (NULL, long_time_format[i], LC_TIME); - if (locale_format == long_time_format[i]) - goto case_long_iso_time_style; - long_time_format[i] = locale_format; - } + long_time_format[i] = + dcgettext (NULL, long_time_format[i], LC_TIME); } } /* Note we leave %5b etc. alone so user widths/flags are honored. */ -- cgit v1.2.3-54-g00ecf