aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--time.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0eb5317d77..cfec8eca59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Sep 5 06:47:22 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * time.c (time_to_s): variable declaration after an execution
+ statement.
+
Tue Sep 5 05:49:41 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (path_check_0): check if sticky bit is set on parent
diff --git a/time.c b/time.c
index 28871834f9..cb2ee465c4 100644
--- a/time.c
+++ b/time.c
@@ -1201,6 +1201,9 @@ time_to_s(VALUE time)
time_t off;
char buf2[32];
char sign = '+';
+#if !defined(HAVE_STRUCT_TM_TM_GMTOFF)
+ VALUE tmp;
+#endif
GetTimeval(time, tobj);
if (tobj->tm_got == 0) {
@@ -1209,7 +1212,7 @@ time_to_s(VALUE time)
#if defined(HAVE_STRUCT_TM_TM_GMTOFF)
off = tobj->tm.tm_gmtoff;
#else
- VALUE tmp = time_utc_offset(time);
+ tmp = time_utc_offset(time);
off = NUM2INT(tmp);
#endif
if (off < 0) {