rcolebaugh / rpms / bash

Forked from rpms/bash a year ago
Clone
287226
			     BASH PATCH REPORT
287226
			     =================
287226
287226
Bash-Release:	4.2
287226
Patch-ID:	bash42-005
287226
287226
Bug-Reported-by:	Dennis Williamson <dennistwilliamson@gmail.com>
287226
Bug-Reference-ID:	<AANLkTikDbEV5rnbPc0zOfmZfBcg0xGetzLLzK+KjRiNa@mail.gmail.com>
287226
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2011-02/msg00147.html
287226
287226
Bug-Description:
287226
287226
Systems that use tzset() to set the local timezone require the TZ variable
287226
to be in the environment.  Bash must make sure the environment has been
287226
modified with any updated value for TZ before calling tzset().  This
287226
affects prompt string expansions and the `%T' printf conversion specification
287226
on systems that do not allow bash to supply a replacement for getenv(3).
287226
287226
Patch (apply with `patch -p0'):
287226
287226
*** ../bash-4.2-patched/variables.h	2010-12-02 20:22:01.000000000 -0500
287226
--- variables.h	2011-02-19 19:57:12.000000000 -0500
287226
***************
287226
*** 314,317 ****
287226
--- 314,318 ----
287226
  extern void sort_variables __P((SHELL_VAR **));
287226
  
287226
+ extern int chkexport __P((char *));
287226
  extern void maybe_make_export_env __P((void));
287226
  extern void update_export_env_inplace __P((char *, int, char *));
287226
*** ../bash-4.2-patched/variables.c	2011-01-24 20:07:48.000000000 -0500
287226
--- variables.c	2011-02-19 20:04:50.000000000 -0500
287226
***************
287226
*** 3654,3657 ****
287226
--- 3654,3673 ----
287226
  }
287226
  
287226
+ int
287226
+ chkexport (name)
287226
+      char *name;
287226
+ {
287226
+   SHELL_VAR *v;
287226
+ 
287226
+   v = find_variable (name);
287226
+   if (exported_p (v))
287226
+     {
287226
+       array_needs_making = 1;
287226
+       maybe_make_export_env ();
287226
+       return 1;
287226
+     }
287226
+   return 0;
287226
+ }
287226
+ 
287226
  void
287226
  maybe_make_export_env ()
287226
***************
287226
*** 4215,4219 ****
287226
    { "TEXTDOMAINDIR", sv_locale },
287226
  
287226
! #if defined (HAVE_TZSET) && defined (PROMPT_STRING_DECODE)
287226
    { "TZ", sv_tz },
287226
  #endif
287226
--- 4231,4235 ----
287226
    { "TEXTDOMAINDIR", sv_locale },
287226
  
287226
! #if defined (HAVE_TZSET)
287226
    { "TZ", sv_tz },
287226
  #endif
287226
***************
287226
*** 4559,4568 ****
287226
  #endif /* HISTORY */
287226
  
287226
! #if defined (HAVE_TZSET) && defined (PROMPT_STRING_DECODE)
287226
  void
287226
  sv_tz (name)
287226
       char *name;
287226
  {
287226
!   tzset ();
287226
  }
287226
  #endif
287226
--- 4575,4585 ----
287226
  #endif /* HISTORY */
287226
  
287226
! #if defined (HAVE_TZSET)
287226
  void
287226
  sv_tz (name)
287226
       char *name;
287226
  {
287226
!   if (chkexport (name))
287226
!     tzset ();
287226
  }
287226
  #endif
287226
*** ../bash-4.2-patched/parse.y	2011-01-02 15:48:11.000000000 -0500
287226
--- parse.y	2011-02-19 20:05:00.000000000 -0500
287226
***************
287226
*** 5136,5139 ****
287226
--- 5136,5142 ----
287226
  	      /* Make the current time/date into a string. */
287226
  	      (void) time (&the_time);
287226
+ #if defined (HAVE_TZSET)
287226
+ 	      sv_tz ("TZ");		/* XXX -- just make sure */
287226
+ #endif
287226
  	      tm = localtime (&the_time);
287226
  
287226
*** ../bash-4.2-patched/builtins/printf.def	2010-11-23 10:02:55.000000000 -0500
287226
--- builtins/printf.def	2011-02-19 20:05:04.000000000 -0500
287226
***************
287226
*** 466,469 ****
287226
--- 466,472 ----
287226
  		else
287226
  		  secs = arg;
287226
+ #if defined (HAVE_TZSET)
287226
+ 		sv_tz ("TZ");		/* XXX -- just make sure */
287226
+ #endif
287226
  		tm = localtime (&secs;;
287226
  		n = strftime (timebuf, sizeof (timebuf), timefmt, tm);
287226
*** ../bash-4.2-patched/patchlevel.h	Sat Jun 12 20:14:48 2010
287226
--- patchlevel.h	Thu Feb 24 21:41:34 2011
287226
***************
287226
*** 26,30 ****
287226
     looks for to find the patch level (for the sccs version string). */
287226
  
287226
! #define PATCHLEVEL 4
287226
  
287226
  #endif /* _PATCHLEVEL_H_ */
287226
--- 26,30 ----
287226
     looks for to find the patch level (for the sccs version string). */
287226
  
287226
! #define PATCHLEVEL 5
287226
  
287226
  #endif /* _PATCHLEVEL_H_ */