summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-13 06:13:51 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-13 06:13:51 +0000
commit4a3df5dc5179103958ad8a96368b64b4c0f3c349 (patch)
tree5b46fecb44e51e5401d1e0acc0b80df0e3d65557 /marshal.c
parentcb3df565d754031841109cfc806610a13bc13f02 (diff)
merges r23999 from trunk into ruby_1_9_1.
-- * marshal.c (r_object0): replace \u by u when the regexp is made by Ruby 1.8. [ruby-dev:36750] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@24074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/marshal.c b/marshal.c
index b76d012bc4..0c49fd3390 100644
--- a/marshal.c
+++ b/marshal.c
@@ -1371,8 +1371,19 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
{
volatile VALUE str = r_bytes(arg);
int options = r_byte(arg);
+ v = r_entry(rb_reg_new("", 0, options), arg);
+ if (ivp) {
+ r_ivar(v, arg);
+ rb_p(v);
+ *ivp = Qfalse;
+ }
+ rb_enc_copy(str, v);
+ if (rb_enc_get_index(str) != rb_utf8_encindex()) {
+#define f_gsub_bang(x,y,z) rb_funcall(x, rb_intern("gsub!"), 2, y, z)
+ f_gsub_bang(str, rb_reg_new("\\\\u", 3, 0), rb_usascii_str_new_cstr("u"));
+ }
v = r_entry(rb_reg_new_str(str, options), arg);
- v = r_leave(v, arg);
+ v = r_leave(v, arg);
}
break;