diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-15 02:27:56 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-15 02:27:56 +0000 |
commit | 87025fdd4345f48821236ff19090976bfc11a2bd (patch) | |
tree | 3f70b2c935c7b86d4111cd6c7e4310ea4a550eea | |
parent | 0c25b62505c64973876e6281193ea6141d396564 (diff) |
* marshal.c (w_object): dump extended modules as well.
* marshal.c (r_object0): TYPE_USRMARSHAL should restore extended
modules before invoking marshal_load. these two fixes are done
by Masatoshi Seki <[email protected]>.
* parse.y (yylex): argument parentheses preceded by spaces should
be warned; not error. [ruby-talk:84103]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | eval.c | 2 | ||||
-rw-r--r-- | ext/socket/extconf.rb | 2 | ||||
-rw-r--r-- | lib/cgi.rb | 1 | ||||
-rw-r--r-- | lib/irb/context.rb | 2 | ||||
-rw-r--r-- | lib/mkmf.rb | 2 | ||||
-rw-r--r-- | marshal.c | 30 | ||||
-rw-r--r-- | parse.y | 3 |
8 files changed, 41 insertions, 14 deletions
@@ -1,3 +1,11 @@ +Wed Oct 15 11:23:05 2003 Yukihiro Matsumoto <[email protected]> + + * marshal.c (w_object): dump extended modules as well. + + * marshal.c (r_object0): TYPE_USRMARSHAL should restore extended + modules before invoking marshal_load. these two fixes are done + by Masatoshi Seki <[email protected]>. + Wed Oct 15 09:30:34 2003 NAKAMURA Usaku <[email protected]> * ext/enumerator/enumerator.c (enumerator_each): avoid VC++ warning. @@ -45,6 +53,11 @@ Wed Oct 15 03:53:20 2003 Hidetoshi NAGAI <[email protected]> * ext/tk/lib/tk.rb: fixed trouble on auto-load Tcl commands (enbug on the last commit). +Wed Oct 15 00:25:00 2003 Yukihiro Matsumoto <[email protected]> + + * parse.y (yylex): argument parentheses preceded by spaces should + be warned; not error. [ruby-talk:84103] + Wed Oct 15 00:20:15 2003 Hidetoshi NAGAI <[email protected]> * ext/tcltklib/tcltklib.c: replace Tcl/Tk's vwait and tkwait to @@ -1332,7 +1332,7 @@ ruby_finalize_0(ex) void ruby_finalize() { - ruby_finalize_0(0); + ruby_finalize_0(EXIT_SUCCESS); } int diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb index 0fcb392690..4f7b49407f 100644 --- a/ext/socket/extconf.rb +++ b/ext/socket/extconf.rb @@ -319,7 +319,7 @@ end $objs = ["socket.#{$OBJEXT}"] -if $getaddr_info_ok and have_func("getaddrinfo") and have_func("getnameinfo") +if $getaddr_info_ok and have_func("getaddrinfo", "netdb.h") and have_func("getnameinfo", "netdb.h") have_getaddrinfo = true else if try_link(<<EOF) diff --git a/lib/cgi.rb b/lib/cgi.rb index 27dd83da01..929ed3fac8 100644 --- a/lib/cgi.rb +++ b/lib/cgi.rb @@ -872,6 +872,7 @@ class CGI raw_cookie.split(/; /).each do |pairs| name, values = pairs.split('=',2) + next unless name and value name = CGI::unescape(name) values ||= "" values = values.split('&').collect{|v| CGI::unescape(v) } diff --git a/lib/irb/context.rb b/lib/irb/context.rb index f4d0d98289..9421608f85 100644 --- a/lib/irb/context.rb +++ b/lib/irb/context.rb @@ -58,7 +58,7 @@ module IRB case input_method when nil - if (defined? (ReadlineInputMethod) && + if (defined?(ReadlineInputMethod) && (use_readline? || IRB.conf[:PROMPT_MODE] != :INF_RUBY && STDIN.tty?)) @io = ReadlineInputMethod.new else diff --git a/lib/mkmf.rb b/lib/mkmf.rb index c002c8893e..ca661d6148 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -394,7 +394,7 @@ def install_files(mfile, ifiles, map = nil, srcprefix = nil) path = Hash.new {|h, i| h[i] = dirs.push([i])[-1]} ifiles.each do |files, dir, prefix| dir = map_dir(dir, map) - prefix = %r"\A#{Regexp.quote(prefix)}/?" if prefix + prefix = %r|\A#{Regexp.quote(prefix)}/?| if prefix if( files[0,2] == "./" ) # install files which are in current working directory. files = files[2..-1] @@ -483,8 +483,7 @@ w_object(obj, arg, limit) VALUE v; v = rb_funcall(obj, s_mdump, 0, 0); - w_byte(TYPE_USRMARSHAL, arg); - w_unique(rb_class2name(CLASS_OF(obj)), arg); + w_class(TYPE_USRMARSHAL, obj, arg); w_object(v, arg, limit); if (ivtbl) w_ivar(0, &c_arg); return; @@ -953,10 +952,11 @@ path2module(path) } static VALUE -r_object0(arg, proc, ivp) +r_object0(arg, proc, ivp, extended) struct load_arg *arg; VALUE proc; int *ivp; + VALUE extended; { VALUE v = Qnil; int type = r_byte(arg); @@ -975,7 +975,7 @@ r_object0(arg, proc, ivp) { int ivar = Qtrue; - v = r_object0(arg, 0, &ivar); + v = r_object0(arg, 0, &ivar, extended); if (ivar) r_ivar(v, arg); } break; @@ -984,8 +984,14 @@ r_object0(arg, proc, ivp) { VALUE m = path2module(r_unique(arg)); - v = r_object0(arg, 0, 0); - rb_extend_object(v, m); + if (NIL_P(extended)) extended = rb_ary_new2(0); + rb_ary_push(extended, m); + + v = r_object0(arg, 0, 0, extended); + while (RARRAY(extended)->len > 0) { + m = rb_ary_pop(extended); + rb_extend_object(v, m); + } } break; @@ -996,7 +1002,7 @@ r_object0(arg, proc, ivp) if (FL_TEST(c, FL_SINGLETON)) { rb_raise(rb_eTypeError, "singleton can't be loaded"); } - v = r_object0(arg, 0, 0); + v = r_object0(arg, 0, 0, extended); if (rb_special_const_p(v) || TYPE(v) == T_OBJECT || TYPE(v) == T_CLASS) { format_error: rb_raise(rb_eArgError, "dump format error (user class)"); @@ -1200,6 +1206,12 @@ r_object0(arg, proc, ivp) VALUE data; v = rb_obj_alloc(klass); + if (! NIL_P(extended)) { + while (RARRAY(extended)->len > 0) { + VALUE m = rb_ary_pop(extended); + rb_extend_object(v, m); + } + } if (!rb_respond_to(v, s_mload)) { rb_raise(rb_eTypeError, "instance of %s needs to have method `marshal_load'", rb_class2name(klass)); @@ -1246,7 +1258,7 @@ r_object0(arg, proc, ivp) "class %s needs to have instance method `_load_data'", rb_class2name(klass)); } - rb_funcall(v, s_load_data, 1, r_object0(arg, 0, 0)); + rb_funcall(v, s_load_data, 1, r_object0(arg, 0, 0, extended)); } break; @@ -1298,7 +1310,7 @@ static VALUE r_object(arg) struct load_arg *arg; { - return r_object0(arg, arg->proc, 0); + return r_object0(arg, arg->proc, 0, Qnil); } static VALUE @@ -4029,7 +4029,8 @@ yylex() c = tLPAREN_ARG; } else if (lex_state == EXPR_ARG) { - c = tLPAREN_ARG; + rb_warn("don't put space before argument parentheses"); + c = '('; } } COND_PUSH(0); |