diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-06-14 08:08:50 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-06-14 08:08:50 +0000 |
commit | 1199a7d3d6399d44662b9a8bea5f359d1fdd40c2 (patch) | |
tree | 41f75742290a2ab9c156eccf4293949fb4c7e0a4 | |
parent | 8c4f656b6cbc088d215b0fd083611e7e6b6040a5 (diff) |
2000-06-14-2
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 24 | ||||
-rw-r--r-- | eval.c | 3 | ||||
-rw-r--r-- | io.c | 7 | ||||
-rw-r--r-- | rubytest.rb | 2 | ||||
-rw-r--r-- | string.c | 39 |
5 files changed, 55 insertions, 20 deletions
@@ -1,5 +1,23 @@ +Wed Jun 14 17:01:41 2000 Katsuyuki Komatsu <[email protected]> + + * rubytest.rb: add CONFIG['EXEEXT'] to the executable file name. + Wed Jun 14 14:50:00 2000 Yukihiro Matsumoto <[email protected]> + * string.c (rb_f_sub): assign to $_ only if modification happens. + + * string.c (rb_f_gsub): ditto. + + * string.c (rb_f_chop): ditto. + + * string.c (rb_f_chomp): ditto. + + * io.c (io_reopen): preserve file position by ftell/fseek, if io + is a seekable. + + * eval.c (method_arity): wrong arity number for the methods with + optional arguments. + * time.c (make_time_t): opposite timezone shift (should be negative). Wed Jun 14 14:07:38 2000 WATANABE Hirofumi <[email protected]> @@ -73,7 +91,7 @@ Fri Jun 9 15:11:35 2000 Yukihiro Matsumoto <[email protected]> * time.c (make_time_t): supports daylight saving time. - * eval.c (rb_thread_safe_level): should retrive current $SAFE + * eval.c (rb_thread_safe_level): should retrieve current $SAFE value if a thread is the current thread. Thu Jun 8 14:25:45 2000 Hiroshi Igarashi <[email protected]> @@ -111,7 +129,7 @@ Mon Jun 5 00:13:35 2000 WATANABE Hirofumi <[email protected]> Sun Jun 4 03:17:36 2000 Wakou Aoyama <[email protected]> - * lib/cig.rb: improve: CGI::pretty() + * lib/cgi.rb: improve: CGI::pretty() Sun Jun 4 02:01:10 2000 WATANABE Hirofumi <[email protected]> @@ -381,7 +399,7 @@ May 16 19:45:32 2000 Katsuyuki Komatsu <[email protected]> * intern.h: use EXTERN instead of extern. - * win32/ruby.h: add rb_defout, rb_stdout, ruby_errinfo, + * win32/ruby.def: add rb_defout, rb_stdout, ruby_errinfo, ruby_sourceline, ruby_sourcefile to work with eruby reported by Hiroshi Saito <[email protected]>. Export both ruby_xmalloc and xmalloc etc. @@ -6165,7 +6165,8 @@ method_arity(method) body = body->nd_head; if (!body) return INT2FIX(0); n = body->nd_cnt; - if (body->nd_rest >= 0) n = -n-1; + if (body->nd_opt || body->nd_rest >= 0) + n = -n-1; return INT2FIX(n); } } @@ -1755,6 +1755,7 @@ io_reopen(io, nfile) OpenFile *fptr, *orig; char *mode; int fd; + long pos; nfile = rb_io_get_io(nfile); if (rb_safe_level() >= 4 && (!OBJ_TAINTED(io) || !OBJ_TAINTED(nfile))) { @@ -1764,6 +1765,9 @@ io_reopen(io, nfile) GetOpenFile(nfile, orig); if (fptr == orig) return io; + if (orig->mode & FMODE_READABLE) { + pos = ftell(orig->f); + } if (orig->f2) { if (fflush(orig->f2) == EOF) rb_sys_fail(orig->path); } @@ -1793,6 +1797,9 @@ io_reopen(io, nfile) if (dup2(fileno(orig->f), fd) < 0) rb_sys_fail(orig->path); fptr->f = rb_fdopen(fd, mode); + if (orig->mode & FMODE_READABLE && pos >= 0) { + fseek(fptr->f, pos, SEEK_SET); + } } if (fptr->f2) { diff --git a/rubytest.rb b/rubytest.rb index a2380e6f4c..c25155bb67 100644 --- a/rubytest.rb +++ b/rubytest.rb @@ -3,7 +3,7 @@ require 'rbconfig' include Config -unless File.exist? "./#{CONFIG['ruby_install_name']}" +unless File.exist? "./#{CONFIG['ruby_install_name']}#{CONFIG['EXEEXT']}" print "./#{CONFIG['ruby_install_name']} is not found.\n" print "Try `make' first, then `make test', please.\n" exit 0 @@ -1313,11 +1313,13 @@ rb_f_sub(argc, argv) int argc; VALUE *argv; { - VALUE str = rb_str_dup(uscore_get()); + VALUE str = uscore_get(); + VALUE dup = rb_str_dup(str); - rb_str_sub_bang(argc, argv, str); - rb_lastline_set(str); - return str; + if (NIL_P(rb_str_sub_bang(argc, argv, dup))) + return str; + rb_lastline_set(dup); + return dup; } static VALUE @@ -1333,11 +1335,13 @@ rb_f_gsub(argc, argv) int argc; VALUE *argv; { - VALUE str = rb_str_dup(uscore_get()); + VALUE str = uscore_get(); + VALUE dup = rb_str_dup(str); - rb_str_gsub_bang(argc, argv, str); - rb_lastline_set(str); - return str; + if (NIL_P(rb_str_gsub_bang(argc, argv, dup))) + return str; + rb_lastline_set(dup); + return dup; } static VALUE @@ -2356,10 +2360,13 @@ rb_f_chop_bang(str) static VALUE rb_f_chop() { - VALUE str = rb_str_dup(uscore_get()); + VALUE str = uscore_get(); - rb_str_chop_bang(str); - rb_lastline_set(str); + if (RSTRING(str)->len > 0) { + str = rb_str_dup(str); + rb_str_chop_bang(str); + rb_lastline_set(str); + } return str; } @@ -2432,11 +2439,13 @@ rb_f_chomp(argc, argv) int argc; VALUE *argv; { - VALUE str = rb_str_dup(uscore_get()); + VALUE str = uscore_get(); + VALUE dup = rb_str_dup(str); - rb_str_chomp_bang(argc, argv, str); - rb_lastline_set(str); - return str; + if (NIL_P(rb_str_chomp_bang(argc, argv, dup))) + return str; + rb_lastline_set(dup); + return dup; } static VALUE |