emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r102178: * configure.in (checking whe


From: Ken Brown
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r102178: * configure.in (checking whether localtime caches TZ): Use
Date: Sun, 31 Oct 2010 19:21:53 -0400
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 102178
committer: Ken Brown <address@hidden>
branch nick: trunk
timestamp: Sun 2010-10-31 19:21:53 -0400
message:
  * configure.in (checking whether localtime caches TZ): Use
  unsetenv instead of modifying environment directly.
modified:
  ChangeLog
  configure
  configure.in
=== modified file 'ChangeLog'
--- a/ChangeLog 2010-10-25 17:23:45 +0000
+++ b/ChangeLog 2010-10-31 23:21:53 +0000
@@ -1,3 +1,8 @@
+2010-10-31  Ken Brown  <address@hidden>
+
+       * configure.in (checking whether localtime caches TZ): Use
+       unsetenv instead of modifying environment directly.
+
 2010-10-25  Andreas Schwab  <address@hidden>
 
        * configure.in (checking for -znocombreloc): Use AC_LANG_PROGRAM

=== modified file 'configure'
--- a/configure 2010-10-25 17:23:45 +0000
+++ b/configure 2010-10-31 23:21:53 +0000
@@ -13982,14 +13982,6 @@
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <time.h>
-extern char **environ;
-unset_TZ ()
-{
-  char **from, **to;
-  for (to = from = environ; (*to = *from); from++)
-    if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
-      to++;
-}
 char TZ_GMT0[] = "TZ=GMT0";
 char TZ_PST8[] = "TZ=PST8";
 main()
@@ -13999,13 +13991,13 @@
   if (putenv (TZ_GMT0) != 0)
     exit (1);
   hour_GMT0 = localtime (&now)->tm_hour;
-  unset_TZ ();
+  unsetenv("TZ");
   hour_unset = localtime (&now)->tm_hour;
   if (putenv (TZ_PST8) != 0)
     exit (1);
   if (localtime (&now)->tm_hour == hour_GMT0)
     exit (1);
-  unset_TZ ();
+  unsetenv("TZ");
   if (localtime (&now)->tm_hour != hour_unset)
     exit (1);
   exit (0);

=== modified file 'configure.in'
--- a/configure.in      2010-10-25 17:23:45 +0000
+++ b/configure.in      2010-10-31 23:21:53 +0000
@@ -2952,14 +2952,6 @@
 AC_CACHE_VAL(emacs_cv_localtime_cache,
 [if test x$ac_cv_func_tzset = xyes; then
 AC_TRY_RUN([#include <time.h>
-extern char **environ;
-unset_TZ ()
-{
-  char **from, **to;
-  for (to = from = environ; (*to = *from); from++)
-    if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
-      to++;
-}
 char TZ_GMT0[] = "TZ=GMT0";
 char TZ_PST8[] = "TZ=PST8";
 main()
@@ -2969,13 +2961,13 @@
   if (putenv (TZ_GMT0) != 0)
     exit (1);
   hour_GMT0 = localtime (&now)->tm_hour;
-  unset_TZ ();
+  unsetenv("TZ");
   hour_unset = localtime (&now)->tm_hour;
   if (putenv (TZ_PST8) != 0)
     exit (1);
   if (localtime (&now)->tm_hour == hour_GMT0)
     exit (1);
-  unset_TZ ();
+  unsetenv("TZ");
   if (localtime (&now)->tm_hour != hour_unset)
     exit (1);
   exit (0);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]