7 Bug-Reported-by: Dennis Williamson <dennistwilliamson@gmail.com>
8 Bug-Reference-ID: <AANLkTikDbEV5rnbPc0zOfmZfBcg0xGetzLLzK+KjRiNa@mail.gmail.com>
9 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-02/msg00147.html
13 Systems that use tzset() to set the local timezone require the TZ variable
14 to be in the environment. Bash must make sure the environment has been
15 modified with any updated value for TZ before calling tzset(). This
16 affects prompt string expansions and the `%T' printf conversion specification
17 on systems that do not allow bash to supply a replacement for getenv(3).
19 Patch (apply with `patch -p0'):
21 *** ../bash-4.2-patched/variables.h 2010-12-02 20:22:01.000000000 -0500
22 --- variables.h 2011-02-19 19:57:12.000000000 -0500
26 extern void sort_variables __P((SHELL_VAR **));
28 + extern int chkexport __P((char *));
29 extern void maybe_make_export_env __P((void));
30 extern void update_export_env_inplace __P((char *, int, char *));
31 *** ../bash-4.2-patched/variables.c 2011-01-24 20:07:48.000000000 -0500
32 --- variables.c 2011-02-19 20:04:50.000000000 -0500
44 + v = find_variable (name);
47 + array_needs_making = 1;
48 + maybe_make_export_env ();
55 maybe_make_export_env ()
58 { "TEXTDOMAINDIR", sv_locale },
60 ! #if defined (HAVE_TZSET) && defined (PROMPT_STRING_DECODE)
64 { "TEXTDOMAINDIR", sv_locale },
66 ! #if defined (HAVE_TZSET)
73 ! #if defined (HAVE_TZSET) && defined (PROMPT_STRING_DECODE)
84 ! #if defined (HAVE_TZSET)
89 ! if (chkexport (name))
93 *** ../bash-4.2-patched/parse.y 2011-01-02 15:48:11.000000000 -0500
94 --- parse.y 2011-02-19 20:05:00.000000000 -0500
98 /* Make the current time/date into a string. */
99 (void) time (&the_time);
100 + #if defined (HAVE_TZSET)
101 + sv_tz ("TZ"); /* XXX -- just make sure */
103 tm = localtime (&the_time);
105 *** ../bash-4.2-patched/builtins/printf.def 2010-11-23 10:02:55.000000000 -0500
106 --- builtins/printf.def 2011-02-19 20:05:04.000000000 -0500
112 + #if defined (HAVE_TZSET)
113 + sv_tz ("TZ"); /* XXX -- just make sure */
115 tm = localtime (&secs);
116 n = strftime (timebuf, sizeof (timebuf), timefmt, tm);
117 *** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
118 --- patchlevel.h Thu Feb 24 21:41:34 2011
121 looks for to find the patch level (for the sccs version string). */
123 ! #define PATCHLEVEL 4
125 #endif /* _PATCHLEVEL_H_ */
127 looks for to find the patch level (for the sccs version string). */
129 ! #define PATCHLEVEL 5
131 #endif /* _PATCHLEVEL_H_ */