bash-4.2-005.patch 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 4.2
  4. Patch-ID: bash42-005
  5. Bug-Reported-by: Dennis Williamson <dennistwilliamson@gmail.com>
  6. Bug-Reference-ID: <AANLkTikDbEV5rnbPc0zOfmZfBcg0xGetzLLzK+KjRiNa@mail.gmail.com>
  7. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-02/msg00147.html
  8. Bug-Description:
  9. Systems that use tzset() to set the local timezone require the TZ variable
  10. to be in the environment. Bash must make sure the environment has been
  11. modified with any updated value for TZ before calling tzset(). This
  12. affects prompt string expansions and the `%T' printf conversion specification
  13. on systems that do not allow bash to supply a replacement for getenv(3).
  14. Patch (apply with `patch -p0'):
  15. *** ../bash-4.2-patched/variables.h 2010-12-02 20:22:01.000000000 -0500
  16. --- ./variables.h 2011-02-19 19:57:12.000000000 -0500
  17. ***************
  18. *** 314,317 ****
  19. --- 314,318 ----
  20. extern void sort_variables __P((SHELL_VAR **));
  21. + extern int chkexport __P((char *));
  22. extern void maybe_make_export_env __P((void));
  23. extern void update_export_env_inplace __P((char *, int, char *));
  24. *** ../bash-4.2-patched/variables.c 2011-01-24 20:07:48.000000000 -0500
  25. --- ./variables.c 2011-02-19 20:04:50.000000000 -0500
  26. ***************
  27. *** 3654,3657 ****
  28. --- 3654,3673 ----
  29. }
  30. + int
  31. + chkexport (name)
  32. + char *name;
  33. + {
  34. + SHELL_VAR *v;
  35. +
  36. + v = find_variable (name);
  37. + if (exported_p (v))
  38. + {
  39. + array_needs_making = 1;
  40. + maybe_make_export_env ();
  41. + return 1;
  42. + }
  43. + return 0;
  44. + }
  45. +
  46. void
  47. maybe_make_export_env ()
  48. ***************
  49. *** 4215,4219 ****
  50. { "TEXTDOMAINDIR", sv_locale },
  51. ! #if defined (HAVE_TZSET) && defined (PROMPT_STRING_DECODE)
  52. { "TZ", sv_tz },
  53. #endif
  54. --- 4231,4235 ----
  55. { "TEXTDOMAINDIR", sv_locale },
  56. ! #if defined (HAVE_TZSET)
  57. { "TZ", sv_tz },
  58. #endif
  59. ***************
  60. *** 4559,4568 ****
  61. #endif /* HISTORY */
  62. ! #if defined (HAVE_TZSET) && defined (PROMPT_STRING_DECODE)
  63. void
  64. sv_tz (name)
  65. char *name;
  66. {
  67. ! tzset ();
  68. }
  69. #endif
  70. --- 4575,4585 ----
  71. #endif /* HISTORY */
  72. ! #if defined (HAVE_TZSET)
  73. void
  74. sv_tz (name)
  75. char *name;
  76. {
  77. ! if (chkexport (name))
  78. ! tzset ();
  79. }
  80. #endif
  81. *** ../bash-4.2-patched/parse.y 2011-01-02 15:48:11.000000000 -0500
  82. --- ./parse.y 2011-02-19 20:05:00.000000000 -0500
  83. ***************
  84. *** 5136,5139 ****
  85. --- 5136,5142 ----
  86. /* Make the current time/date into a string. */
  87. (void) time (&the_time);
  88. + #if defined (HAVE_TZSET)
  89. + sv_tz ("TZ"); /* XXX -- just make sure */
  90. + #endif
  91. tm = localtime (&the_time);
  92. *** ../bash-4.2-patched/builtins/printf.def 2010-11-23 10:02:55.000000000 -0500
  93. --- ./builtins/printf.def 2011-02-19 20:05:04.000000000 -0500
  94. ***************
  95. *** 466,469 ****
  96. --- 466,472 ----
  97. else
  98. secs = arg;
  99. + #if defined (HAVE_TZSET)
  100. + sv_tz ("TZ"); /* XXX -- just make sure */
  101. + #endif
  102. tm = localtime (&secs);
  103. n = strftime (timebuf, sizeof (timebuf), timefmt, tm);
  104. *** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
  105. --- ./patchlevel.h Thu Feb 24 21:41:34 2011
  106. ***************
  107. *** 26,30 ****
  108. looks for to find the patch level (for the sccs version string). */
  109. ! #define PATCHLEVEL 4
  110. #endif /* _PATCHLEVEL_H_ */
  111. --- 26,30 ----
  112. looks for to find the patch level (for the sccs version string). */
  113. ! #define PATCHLEVEL 5
  114. #endif /* _PATCHLEVEL_H_ */