From 63a17aa5a2ecc674d107f76d03a9cf0c75ffcf2f Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 12 Mar 2002 09:27:29 +0000 Subject: [PATCH] * regex.c (re_compile_pattern): '\0111' should be '\011' plus '1', since octal literals are formed by three digits at most. * eval.c (rb_eval_cmd): cbase should not be NULL; it should be either ruby_wrapper or Object. * enum.c (enum_each_with_index): should return self. * process.c (proc_setpgrp): should return value for non-void function. * process.c (proc_getpgid): should raise exception if getpgid() return -1. * string.c (rb_str_ljust): should return a duplicated string. * string.c (rb_str_rjust): ditto. * string.c (rb_str_center): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 24 ++++++++++++++++++++++++ enum.c | 2 +- eval.c | 3 ++- ext/tk/lib/tk.rb | 4 ++-- process.c | 2 ++ regex.c | 2 +- string.c | 6 +++--- version.h | 4 ++-- 8 files changed, 37 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 063778a2e5..3f80ba6924 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +Mon Mar 11 18:03:37 2002 Yukihiro Matsumoto + + * regex.c (re_compile_pattern): '\0111' should be '\011' plus '1', + since octal literals are formed by three digits at most. + +Mon Mar 11 14:44:38 2002 Yukihiro Matsumoto + + * eval.c (rb_eval_cmd): cbase should not be NULL; it should be + either ruby_wrapper or Object. + +Sun Mar 10 02:18:22 2002 Koji Arai + + * enum.c (enum_each_with_index): should return self. + + * process.c (proc_setpgrp): should return value for non-void function. + + * process.c (proc_getpgid): should raise exception if getpgid() return -1. + + * string.c (rb_str_ljust): should return a duplicated string. + + * string.c (rb_str_rjust): ditto. + + * string.c (rb_str_center): ditto. + Fri Mar 8 02:21:32 2002 Yukihiro Matsumoto * eval.c (cvar_cbase): utility function to find innermost non diff --git a/enum.c b/enum.c index 5adbef4962..e896ee394b 100644 --- a/enum.c +++ b/enum.c @@ -319,7 +319,7 @@ enum_each_with_index(obj) rb_iterate(rb_each, obj, each_with_index_i, (VALUE)memo); rb_gc_force_recycle((VALUE)memo); - return Qnil; + return obj; } void diff --git a/eval.c b/eval.c index d12a9dc8ba..90d6bde62e 100644 --- a/eval.c +++ b/eval.c @@ -1338,7 +1338,8 @@ rb_eval_cmd(cmd, arg) ruby_frame->last_func = 0; ruby_frame->last_class = 0; ruby_frame->self = ruby_top_self; - ruby_frame->cbase = (VALUE)rb_node_newnode(NODE_CREF,ruby_wrapper,0,0); + ruby_frame->cbase = (VALUE)rb_node_newnode(NODE_CREF,0,0,0); + RNODE(ruby_frame->cbase)->nd_clss = ruby_wrapper ? ruby_wrapper : rb_cObject; if (OBJ_TAINTED(cmd)) { ruby_safe_level = 4; diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index f77bc8f0b7..e16895a190 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -945,8 +945,8 @@ module Tk def sizefrom(*args) tk_call('wm', 'sizefrom', path, *args) end - def state - tk_call 'wm', 'state', path + def state(state=None) + tk_call 'wm', 'state', path, state end def title(*args) tk_call 'wm', 'title', path, *args diff --git a/process.c b/process.c index 2fc62828d0..cb4eae0a1a 100644 --- a/process.c +++ b/process.c @@ -843,6 +843,7 @@ proc_getpgid(obj, pid) int i; i = getpgid(NUM2INT(pid)); + if (i < 0) rb_sys_fail(0); return INT2NUM(i); #else rb_notimplement(); @@ -940,6 +941,7 @@ proc_setpriority(obj, which, who, prio) #else rb_notimplement(); #endif + return INT2FIX(0); } static VALUE diff --git a/regex.c b/regex.c index eddfd2817b..2ed6a7ba78 100644 --- a/regex.c +++ b/regex.c @@ -2267,7 +2267,7 @@ re_compile_pattern(pattern, size, bufp) /* octal */ case '0': had_mbchar = 0; - c = scan_oct(p, 3, &numlen); + c = scan_oct(p, 2, &numlen); p += numlen; had_num_literal = 1; goto numeric_char; diff --git a/string.c b/string.c index 099f6a81d1..5244f8e5f2 100644 --- a/string.c +++ b/string.c @@ -2728,7 +2728,7 @@ rb_str_ljust(str, w) VALUE res; char *p, *pend; - if (width < 0 || RSTRING(str)->len >= width) return str; + if (width < 0 || RSTRING(str)->len >= width) return rb_str_dup(str); res = rb_str_new(0, width); RBASIC(res)->klass = rb_obj_class(str); memcpy(RSTRING(res)->ptr, RSTRING(str)->ptr, RSTRING(str)->len); @@ -2749,7 +2749,7 @@ rb_str_rjust(str, w) VALUE res; char *p, *pend; - if (width < 0 || RSTRING(str)->len >= width) return str; + if (width < 0 || RSTRING(str)->len >= width) return rb_str_dup(str); res = rb_str_new(0, width); RBASIC(res)->klass = rb_obj_class(str); p = RSTRING(res)->ptr; pend = p + width - RSTRING(str)->len; @@ -2771,7 +2771,7 @@ rb_str_center(str, w) char *p, *pend; long n; - if (width < 0 || RSTRING(str)->len >= width) return str; + if (width < 0 || RSTRING(str)->len >= width) return rb_str_dup(str); res = rb_str_new(0, width); RBASIC(res)->klass = rb_obj_class(str); n = (width - RSTRING(str)->len)/2; diff --git a/version.h b/version.h index 7226b593bd..13474adc13 100644 --- a/version.h +++ b/version.h @@ -1,4 +1,4 @@ #define RUBY_VERSION "1.6.7" -#define RUBY_RELEASE_DATE "2002-03-08" +#define RUBY_RELEASE_DATE "2002-03-12" #define RUBY_VERSION_CODE 167 -#define RUBY_RELEASE_CODE 20020308 +#define RUBY_RELEASE_CODE 20020312