summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-04 21:48:47 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-04 21:48:47 +0000
commit6a0636b2d40424faa55cd864db28649d0de1b942 (patch)
tree387a84b4659f23c25555e0787ef197101bea7d73 /time.c
parentb9a508bb9613b10e88611284448c4b7dfbeefc81 (diff)
* time.c (time_to_s): variable declaration after an execution
statement. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r--time.c5
1 files changed, 4 insertions, 1 deletions
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) {