aboutsummaryrefslogtreecommitdiffstats
path: root/locale.c
diff options
context:
space:
mode:
authorJari Aalto <jari.aalto@cante.net>2005-12-07 14:08:12 +0000
committerJari Aalto <jari.aalto@cante.net>2009-09-12 16:46:57 +0000
commit95732b497d12c98613bb3c5db16b61f377501a59 (patch)
tree5e1cdf79eb0407e09dca4c0ec29e11442c7d1d15 /locale.c
parenteb87367179effbe5f430236db8259006d71438b7 (diff)
downloadandroid_external_bash-95732b497d12c98613bb3c5db16b61f377501a59.tar.gz
android_external_bash-95732b497d12c98613bb3c5db16b61f377501a59.tar.bz2
android_external_bash-95732b497d12c98613bb3c5db16b61f377501a59.zip
Imported from ../bash-3.1.tar.gz.
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/locale.c b/locale.c
index 0c4772a..48e44ec 100644
--- a/locale.c
+++ b/locale.c
@@ -71,8 +71,8 @@ set_default_locale ()
textdomain (PACKAGE);
}
-/* Set default values for LC_CTYPE, LC_COLLATE, LC_MESSAGES and LC_NUMERIC
- if they are not specified in the environment, but LC_ALL is. This
+/* Set default values for LC_CTYPE, LC_COLLATE, LC_MESSAGES, LC_NUMERIC and
+ LC_TIME if they are not specified in the environment, but LC_ALL is. This
should be called from main() after parsing the environment. */
void
set_default_locale_vars ()
@@ -109,6 +109,12 @@ set_default_locale_vars ()
setlocale (LC_NUMERIC, lc_all);
# endif /* LC_NUMERIC */
+# if defined (LC_TIME)
+ val = get_string_value ("LC_TIME");
+ if (val == 0 && lc_all && *lc_all)
+ setlocale (LC_TIME, lc_all);
+# endif /* LC_TIME */
+
#endif /* HAVE_SETLOCALE */
val = get_string_value ("TEXTDOMAIN");
@@ -213,7 +219,15 @@ set_locale_var (var, value)
return (setlocale (LC_NUMERIC, get_locale_var ("LC_NUMERIC")) != 0);
# endif /* LC_NUMERIC */
}
+ else if (var[3] == 'T' && var[4] == 'I') /* LC_TIME */
+ {
+# if defined (LC_TIME)
+ if (lc_all == 0 || *lc_all == '\0')
+ return (setlocale (LC_TIME, get_locale_var ("LC_TIME")) != 0);
+# endif /* LC_TIME */
+ }
#endif /* HAVE_SETLOCALE */
+
return (0);
}
@@ -285,6 +299,9 @@ reset_locale_vars ()
# if defined (LC_NUMERIC)
setlocale (LC_NUMERIC, get_locale_var ("LC_NUMERIC"));
# endif
+# if defined (LC_TIME)
+ setlocale (LC_TIME, get_locale_var ("LC_TIME"));
+# endif
locale_setblanks ();