[macruby-changes] [454] MacRuby/branches/lrz_unstable

source_changes at macosforge.org source_changes at macosforge.org
Tue Aug 19 14:41:47 PDT 2008


Revision: 454
          http://trac.macosforge.org/projects/ruby/changeset/454
Author:   lsansonetti at apple.com
Date:     2008-08-19 14:41:46 -0700 (Tue, 19 Aug 2008)
Log Message:
-----------
wip

Modified Paths:
--------------
    MacRuby/branches/lrz_unstable/parse.y
    MacRuby/branches/lrz_unstable/string.c

Modified: MacRuby/branches/lrz_unstable/parse.y
===================================================================
--- MacRuby/branches/lrz_unstable/parse.y	2008-08-19 09:01:27 UTC (rev 453)
+++ MacRuby/branches/lrz_unstable/parse.y	2008-08-19 21:41:46 UTC (rev 454)
@@ -9524,21 +9524,23 @@
 ID
 rb_intern_str(VALUE str)
 {
-    rb_encoding *enc;
     ID id;
 
 #if WITH_OBJC
+    const char *s = RSTRING_PTR(str);
+    id = rb_intern3(s, strlen(s), NULL);
+#else
+    rb_encoding *enc;
     enc = rb_enc_get(str);
-#else
     if (rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT) {
 	enc = rb_usascii_encoding();
     }
     else {
 	enc = rb_enc_get(str);
     }
-#endif
     id = rb_intern3(RSTRING_PTR(str), RSTRING_LEN(str), enc);
     RB_GC_GUARD(str);
+#endif
     return id;
 }
 

Modified: MacRuby/branches/lrz_unstable/string.c
===================================================================
--- MacRuby/branches/lrz_unstable/string.c	2008-08-19 09:01:27 UTC (rev 453)
+++ MacRuby/branches/lrz_unstable/string.c	2008-08-19 21:41:46 UTC (rev 454)
@@ -2523,7 +2523,6 @@
     }
     if (p == NULL)
 	return rb_str_new2("\"\"");
-    p = RSTRING_BYTEPTR(str); pend = RSTRING_END(str);
     result = rb_str_buf_new2("");
     str_cat_char(result, '"', enc);
     while (p < pend) {
@@ -2584,8 +2583,8 @@
 	}
     }
     str_cat_char(result, '"', enc);
+    RSTRING_SYNC(result);
 
-    OBJ_INFECT(result, str);
     return result;
 }
 
@@ -2709,7 +2708,6 @@
 
     }
 
-    OBJ_INFECT(result, str);
     /* result from dump is ASCII */
 
     RSTRING_SYNC(result);
@@ -4445,8 +4443,6 @@
     if (s == NULL)
 	s = "";
     result = rb_str_new2(crypt(s, RSTRING_BYTEPTR(salt)));
-    OBJ_INFECT(result, str);
-    OBJ_INFECT(result, salt);
     return result;
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080819/72466e91/attachment.html 


More information about the macruby-changes mailing list