[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r1979 - in glibc-package/branches/glibc-2.5/debian: . patches patches/any



Author: madcoder
Date: 2007-02-12 10:39:41 +0100 (Mon, 12 Feb 2007)
New Revision: 1979

Added:
   glibc-package/branches/glibc-2.5/debian/patches/any/submitted-date-and-unknown-tz.diff
Modified:
   glibc-package/branches/glibc-2.5/debian/changelog
   glibc-package/branches/glibc-2.5/debian/patches/series
Log:
Closes #55648.

  * patches/any/submitted-date-and-unknown-tz.diff: fix date output in case of
    an unknown timezone in $TZ, submitted upstream as #4028. Closes: #55648.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>


Modified: glibc-package/branches/glibc-2.5/debian/changelog
===================================================================
--- glibc-package/branches/glibc-2.5/debian/changelog	2007-02-12 09:26:01 UTC (rev 1978)
+++ glibc-package/branches/glibc-2.5/debian/changelog	2007-02-12 09:39:41 UTC (rev 1979)
@@ -148,6 +148,8 @@
     ordering for it to be defined correctly. Closes: #377416.
   * Fix rpcgen(1) manpage, to match rpcgen(1) behaviour more closely.
     Closes: #46175.
+  * patches/any/submitted-date-and-unknown-tz.diff: fix date output in case of
+    an unknown timezone in $TZ, submitted upstream as #4028. Closes: #55648.
 
  -- Aurelien Jarno <aurel32@debian.org>  Wed,  7 Feb 2007 13:56:40 +0100
 

Added: glibc-package/branches/glibc-2.5/debian/patches/any/submitted-date-and-unknown-tz.diff
===================================================================
--- glibc-package/branches/glibc-2.5/debian/patches/any/submitted-date-and-unknown-tz.diff	2007-02-12 09:26:01 UTC (rev 1978)
+++ glibc-package/branches/glibc-2.5/debian/patches/any/submitted-date-and-unknown-tz.diff	2007-02-12 09:39:41 UTC (rev 1979)
@@ -0,0 +1,49 @@
+Patch from Andrew Suffield:
+> 'TZ=MOO date' gives confusing output; it uses UTC but claims to be
+> whatever timezone you told it. If you were expecting the timezone to
+> be valid, this output is not correct.
+> 
+> This is caused by the way that glibc parses $TZ; if the string is
+> unrecognised, it interprets it as a name followed by an offset from
+> UTC. (The relevant code is tzset_internal() in time/tzset.c)
+> 
+> The code already checks to see whether there is a valid offset in the
+> string or not. Currently it copies the timezone name first; since the
+> intent was probably not to change the name if no offset was specified,
+> I propose this change:
+> 
+> [... see patch below ...]
+> 
+> The old behaviour is still available by using TZ="MOO+0", if it is
+> really desirable to change the name of the timezone in this manner.
+
+Index: time/tzset.c
+===================================================================
+--- time/tzset.c.orig
++++ time/tzset.c
+@@ -216,7 +216,7 @@
+ 
+   /* Clear out old state and reset to unnamed UTC.  */
+   memset (tz_rules, 0, sizeof tz_rules);
+-  tz_rules[0].name = tz_rules[1].name = "";
++  tz_rules[0].name = tz_rules[1].name = "UTC";
+ 
+   /* Get the standard timezone name.  */
+   tzbuf = strdupa (tz);
+@@ -225,14 +225,14 @@
+       (l = strlen (tzbuf)) < 3)
+     goto out;
+ 
+-  tz_rules[0].name = __tzstring (tzbuf);
+-
+   tz += l;
+ 
+   /* Figure out the standard offset from UTC.  */
+   if (*tz == '\0' || (*tz != '+' && *tz != '-' && !isdigit (*tz)))
+     goto out;
+ 
++  tz_rules[0].name = __tzstring (tzbuf);
++
+   if (*tz == '-' || *tz == '+')
+     tz_rules[0].offset = *tz++ == '-' ? 1L : -1L;
+   else

Modified: glibc-package/branches/glibc-2.5/debian/patches/series
===================================================================
--- glibc-package/branches/glibc-2.5/debian/patches/series	2007-02-12 09:26:01 UTC (rev 1978)
+++ glibc-package/branches/glibc-2.5/debian/patches/series	2007-02-12 09:39:41 UTC (rev 1979)
@@ -131,3 +131,4 @@
 any/submitted-getcwd-sys_param_h.diff -p0
 any/submitted-clock-settime.diff -p0
 any/submitted-argph.h.diff
+any/submitted-date-and-unknown-tz.diff -p0



Reply to: