From 1fe40b7cc5e92105f636d670d77b059fe4a4c50b Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 3 Oct 2001 07:19:19 +0000 Subject: * marshal.c (r_object): better allocation type check for TYPE_UCLASS. usage of allocation framework is disabled for now. * variable.c (rb_class_path): Module may have subclass. * string.c (rb_str_update): should maintain original negative offset. * string.c (rb_str_subpat_set): ditto * string.c (rb_str_aset): ditto. * re.c (rb_reg_nth_match): should check negative nth. * re.c (rb_reg_nth_defined): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- rubyio.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'rubyio.h') diff --git a/rubyio.h b/rubyio.h index d3d93ef6b7..6e63711ee9 100644 --- a/rubyio.h +++ b/rubyio.h @@ -35,6 +35,11 @@ typedef struct OpenFile { #define GetOpenFile(obj,fp) rb_io_check_closed((fp) = RFILE(rb_io_taint_check(obj))->fptr) #define MakeOpenFile(obj, fp) do {\ + if (RFILE(obj)->fptr) {\ + rb_io_close(obj);\ + free(RFILE(obj)->fptr);\ + RFILE(obj)->fptr = 0;\ + }\ fp = 0;\ fp = RFILE(obj)->fptr = ALLOC(OpenFile);\ fp->f = fp->f2 = NULL;\ -- cgit v1.2.3