aboutsummaryrefslogtreecommitdiffstats
path: root/variables.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2011-11-22 20:00:19 -0500
committerChet Ramey <chet.ramey@case.edu>2011-11-22 20:00:19 -0500
commit2bbe80583bb601cdca730a4aafebb5622b6dddc1 (patch)
tree9c66fa5dbafa184fb1e7cecf5731e8145f52f861 /variables.c
parentaeb26a67db0df058436b835363fc433e258719f3 (diff)
downloadandroid_external_bash-2bbe80583bb601cdca730a4aafebb5622b6dddc1.tar.gz
android_external_bash-2bbe80583bb601cdca730a4aafebb5622b6dddc1.tar.bz2
android_external_bash-2bbe80583bb601cdca730a4aafebb5622b6dddc1.zip
Bash-4.2 patch 5
Diffstat (limited to 'variables.c')
-rw-r--r--variables.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/variables.c b/variables.c
index 3c20c3c..daacdbf 100644
--- a/variables.c
+++ b/variables.c
@@ -3653,6 +3653,22 @@ n_shell_variables ()
return n;
}
+int
+chkexport (name)
+ char *name;
+{
+ SHELL_VAR *v;
+
+ v = find_variable (name);
+ if (exported_p (v))
+ {
+ array_needs_making = 1;
+ maybe_make_export_env ();
+ return 1;
+ }
+ return 0;
+}
+
void
maybe_make_export_env ()
{
@@ -4214,7 +4230,7 @@ static struct name_and_function special_vars[] = {
{ "TEXTDOMAIN", sv_locale },
{ "TEXTDOMAINDIR", sv_locale },
-#if defined (HAVE_TZSET) && defined (PROMPT_STRING_DECODE)
+#if defined (HAVE_TZSET)
{ "TZ", sv_tz },
#endif
@@ -4558,12 +4574,13 @@ sv_histtimefmt (name)
}
#endif /* HISTORY */
-#if defined (HAVE_TZSET) && defined (PROMPT_STRING_DECODE)
+#if defined (HAVE_TZSET)
void
sv_tz (name)
char *name;
{
- tzset ();
+ if (chkexport (name))
+ tzset ();
}
#endif