tags 427351 + patch
thanks

hi,

i think attached patch should fix this issue,

bye,
    - michael
--- orig/libcairo-ruby-1.4.1/src/rb_cairo_surface.c	2007-03-06 13:17:34.000000000 +0100
+++ patch/libcairo-ruby-1.4.1/src/rb_cairo_surface.c	2007-06-04 13:00:42.000000000 +0200
@@ -29,6 +29,7 @@
 VALUE rb_cCairo_PDFSurface;
 VALUE rb_cCairo_PSSurface;
 VALUE rb_cCairo_SVGSurface;
+EXTERN VALUE ruby_errinfo;
 
 static ID cr_id_target;
 static ID cr_id_read;
@@ -143,13 +144,13 @@
   output = closure->target;
   data = rb_str_new ((const char *)closure->data, closure->length);
 
-  length = RSTRING (data)->len;
+  length = RSTRING_LEN(data);
   while (length != 0)
     {
       VALUE rb_written_bytes = rb_funcall (output, cr_id_write, 1, data);
       written_bytes = NUM2LONG (rb_written_bytes);
       data = rb_str_substr (data, written_bytes,
-                            RSTRING (data)->len - written_bytes);
+                            RSTRING_LEN(data) - written_bytes);
       length -= written_bytes;
     }
   
@@ -190,7 +191,7 @@
   
   result = rb_str_new2 ("");
 
-  for (rest = length; rest != 0; rest = length - RSTRING (result)->len)
+  for (rest = length; rest != 0; rest = length - RSTRING_LEN(result))
     {
       rb_str_concat (result, rb_funcall (input, cr_id_read, 1, INT2NUM (rest)));
     }

Reply via email to