[#2139] Best way to install ri documentation — Dave Thomas <dave@...>

Folks:

69 messages 2004/01/04
[#2140] Re: Best way to install ri documentation — Gavin Sinclair <gsinclair@...> 2004/01/04

On Monday, January 5, 2004, 2:29:57 AM, Dave wrote:

[#2141] Re: Best way to install ri documentation — matz@... (Yukihiro Matsumoto) 2004/01/04

Hi,

[#2145] Re: Best way to install ri documentation — Richard Kilmer <rich@...> 2004/01/05

Perhaps make it available for mirrors and save ruby-lang's bandwidth?

[#2147] Re: Best way to install ri documentation — Dave Thomas <dave@...> 2004/01/05

[#2148] Re: Best way to install ri documentation -- please check this — Dave Thomas <dave@...> 2004/01/05

So, I'm thinking about doing the following? Is this OK with everyone?

[#2149] Re: Best way to install ri documentation -- please check this — "J.Herre" <jlst@...> 2004/01/05

[#2152] Re: Best way to install ri documentation -- please check this — Dave Thomas <dave@...> 2004/01/05

[#2153] Re: Best way to install ri documentation -- please check this — nobu.nokada@... 2004/01/05

Hi,

[#2154] Re: Best way to install ri documentation -- please check this — Dave Thomas <dave@...> 2004/01/05

[#2219] Re: Best way to install ri documentation -- please check this — "James F. Hranicky" <jfh@...> 2004/01/12

On Tue, 6 Jan 2004 00:47:41 +0900

[#2194] File.readable_world? and File.writable_world? — Ian Macdonald <ian@...>

Hello,

27 messages 2004/01/09
[#2195] Re: [PATCH] File.readable_world? and File.writable_world? — Eivind Eklund <eivind@...> 2004/01/09

On Fri, Jan 09, 2004 at 06:02:07PM +0900, Ian Macdonald wrote:

[#2199] Re: [PATCH] File.readable_world? and File.writable_world? — Ian Macdonald <ian@...> 2004/01/09

On Fri 09 Jan 2004 at 23:10:02 +0900, Eivind Eklund wrote:

[#2200] Re: [PATCH] File.readable_world? and File.writable_world? — matz@... (Yukihiro Matsumoto) 2004/01/10

Hi,

[#2203] Re: [PATCH] File.readable_world? and File.writable_world? — Ian Macdonald <ian@...> 2004/01/11

On Sun 11 Jan 2004 at 00:47:33 +0900, Yukihiro Matsumoto wrote:

[#2206] Re: [PATCH] File.readable_world? and File.writable_world? — matz@... (Yukihiro Matsumoto) 2004/01/11

Hi,

[#2208] Re: [PATCH] File.readable_world? and File.writable_world? — Ian Macdonald <ian@...> 2004/01/11

On Sun 11 Jan 2004 at 21:40:22 +0900, Yukihiro Matsumoto wrote:

[#2209] Re: [PATCH] File.readable_world? and File.writable_world? — matz@... (Yukihiro Matsumoto) 2004/01/12

Hi,

[#2216] ruby aborts in data-handling applications — xsdg <xsdg@...>

I reported a similar bug about 2 or 3 months ago. The problem seemed to go

12 messages 2004/01/12

[syck] Time#usec round trip problem

From: Minero Aoki <aamine@...>
Date: 2004-01-26 02:58:49 UTC
List: ruby-core #2305
Hi,

I have found that the syck library does not dump
tv_usec correctly:

  ~ % cat t
  require 'yaml'
  t = Time.now
  5.times do
    p t.usec
    puts YAML.dump(t)
    t = YAML.load(YAML.dump(t))
  end

  ~ % ruby -v t
  ruby 1.9.0 (2004-01-25) [i686-linux]
  357164
  --- 2004-01-26 09:55:52.357164 +09:00
  357162
  --- 2004-01-26 09:55:52.357162 +09:00
  357161
  --- 2004-01-26 09:55:52.357161 +09:00
  357161
  --- 2004-01-26 09:55:52.357161 +09:00
  357161
  --- 2004-01-26 09:55:52.357161 +09:00

The attached patch will fix this problem.

Regards,
Minero Aoki

Index: rubyext.c
===================================================================
RCS file: /src/ruby/ext/syck/rubyext.c,v
retrieving revision 1.33
diff -u -p -r1.33 rubyext.c
--- rubyext.c	13 Jan 2004 07:57:33 -0000	1.33
+++ rubyext.c	26 Jan 2004 02:33:49 -0000
@@ -198,7 +198,8 @@ rb_syck_mktime(str)
 {
     VALUE time;
     char *ptr = str;
-    VALUE year, mon, day, hour, min, sec, usec;
+    VALUE year, mon, day, hour, min, sec;
+    long usec;
 
     /* Year*/
     ptr[4] = '\0';
@@ -233,23 +234,22 @@ rb_syck_mktime(str)
     ptr += 2;
     if ( *ptr == '.' )
     {
-        usec = INT2FIX( strtod( ptr, NULL ) * 1000000 );
+        usec = strtol(ptr + 1, NULL, 10);
     }
     else
     {
-        usec = INT2FIX( 0 );
+        usec = 0;
     }
 
     /* Make UTC time*/
-    time = rb_funcall(rb_cTime, s_utc, 7, year, mon, day, hour, min, sec, usec);
+    time = rb_funcall(rb_cTime, s_utc, 7, year, mon, day, hour, min, sec, INT2FIX(0));
 
     /* Time Zone*/
     while ( *ptr != 'Z' && *ptr != '+' && *ptr != '-' && *ptr != '\0' ) ptr++;
     if ( *ptr == '-' || *ptr == '+' )
     {
-        double tz_offset = 0;
-        double utc_time = 0;
-        tz_offset += strtod(ptr, NULL) * 3600;
+        long tz_offset = strtol(ptr, NULL, 10) * 3600;
+        long t;
 
         while ( *ptr != ':' && *ptr != '\0' ) ptr++;
         if ( *ptr == ':' )
@@ -257,18 +257,17 @@ rb_syck_mktime(str)
             ptr += 1;
             if ( tz_offset < 0 )
             {
-                tz_offset -= strtod(ptr, NULL) * 60;
+                tz_offset -= strtol(ptr, NULL, 10) * 60;
             }
             else
             {
-                tz_offset += strtod(ptr, NULL) * 60;
+                tz_offset += strtol(ptr, NULL, 10) * 60;
             }
         }
 
         /* Make TZ time*/
-        utc_time = NUM2DBL(rb_funcall(time, s_to_f, 0));
-        utc_time -= tz_offset;
-        time = rb_funcall(rb_cTime, s_at, 1, rb_float_new(utc_time));
+        t = NUM2LONG(rb_funcall(time, s_to_i, 0)) - tz_offset;
+        time = rb_funcall(rb_cTime, s_at, 2, LONG2NUM(t), LONG2NUM(usec));
     }
 
     return time;

In This Thread

Prev Next