1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* io.c (rb_f_open): open should not ignore block when "to_open"

method is used.  [ruby-dev:23478]

* ext/dbm/dbm.c (fdbm_modify): typo fixed. [ruby-dev:23473]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2004-05-08 08:12:08 +00:00
parent 8d7d25a054
commit 2c247e3d6b
6 changed files with 17 additions and 14 deletions

View file

@ -1,3 +1,8 @@
Sat May 8 10:53:30 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (rb_f_open): open should not ignore block when "to_open"
method is used. [ruby-dev:23478]
Fri May 7 22:07:39 2004 Minero Aoki <aamine@loveruby.net>
* lib/fileutils.rb (mv): new option `force'. [ruby-talk:99457]
@ -22,6 +27,10 @@ Fri May 7 21:03:51 2004 Minero Aoki <aamine@loveruby.net>
* test/fileutils/test_fileutils.rb (mkdir): test "\n" in path.
Fri May 7 20:53:25 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/dbm/dbm.c (fdbm_modify): typo fixed. [ruby-dev:23473]
Fri May 7 11:17:27 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* util.c (ruby_strtod): 0.0000000000000000001 == 0.0 should be false.

View file

@ -285,9 +285,7 @@ fdbm_modify(obj)
VALUE obj;
{
rb_secure(4);
if (OBJ_FROZEN_P(obj)) {
if (OBJ_FROZEN(obj)) rb_error_frozen("DBM");
}
if (OBJ_FROZEN(obj)) rb_error_frozen("DBM");
}
static VALUE

View file

@ -392,9 +392,7 @@ rb_gdbm_modify(obj)
VALUE obj;
{
rb_secure(4);
if (OBJ_FROZEN_P(obj)) {
if (OBJ_FROZEN(obj)) rb_error_frozen("GDBM");
}
if (OBJ_FROZEN(obj)) rb_error_frozen("GDBM");
}
static VALUE

View file

@ -273,9 +273,7 @@ fdbm_modify(obj)
VALUE obj;
{
rb_secure(4);
if (OBJ_FROZEN_P(obj)) {
if (OBJ_FROZEN(obj)) rb_error_frozen("SDBM");
}
if (OBJ_FROZEN(obj)) rb_error_frozen("SDBM");
}
static VALUE

6
io.c
View file

@ -3071,7 +3071,11 @@ rb_f_open(argc, argv)
ID to_open = rb_intern("to_open");
if (rb_respond_to(argv[0], to_open)) {
return rb_funcall2(argv[0], to_open, argc-1, argv+1);
VALUE io = rb_funcall2(argv[0], to_open, argc-1, argv+1);
if (rb_block_given_p()) {
return rb_ensure(rb_yield, io, io_close, io);
}
return io;
}
else {
VALUE tmp = rb_check_string_type(argv[0]);

View file

@ -234,10 +234,6 @@ class Pathname
"#<#{self.class}:#{@path}>"
end
def to_open(*args) # :nodoc:
Kernel::open(@path, *args)
end
#
# Returns clean pathname of +self+ with consecutive slashes and useless dots
# removed. The filesystem is not accessed.