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

* io.c (rb_io_putc): output via rb_io_write().

* re.c (rb_reg_initialize_m): frozen check should be moved here
  from rb_reg_initialize().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2002-08-20 07:36:01 +00:00
parent e0c5eed65c
commit c8c55db68a
4 changed files with 17 additions and 21 deletions

View file

@ -1,3 +1,7 @@
Tue Aug 20 12:12:25 2002 Tietew <tietew@tietew.net>
* io.c (rb_io_putc): output via rb_io_write().
Mon Aug 19 19:01:55 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* misc/inf-ruby.el (inf-ruby-keys): ruby-send-definition
@ -11,6 +15,11 @@ Mon Aug 19 19:01:55 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* misc/inf-ruby.el (ruby-send-terminator): added to make unique
terminator.
Mon Aug 19 17:08:19 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
* re.c (rb_reg_initialize_m): frozen check should be moved here
from rb_reg_initialize().
Mon Aug 19 15:38:44 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
* array.c (sort_2): comparison should be done as signed long.

1
ToDo
View file

@ -35,6 +35,7 @@ Language Spec.
* selector namespace - something like generic-flet in CLOS, to help RubyBehevior
* private instance variable (as in Python?) @_foo in class Foo => @_Foo_foo
* warn/error "bare word" method, like "foo", you should type "foo()"
* clarify evaluation order of operator argument (=~, .., ...)
Hacking Interpreter

22
io.c
View file

@ -2381,24 +2381,10 @@ static VALUE
rb_io_putc(io, ch)
VALUE io, ch;
{
OpenFile *fptr;
FILE *f;
int c = NUM2CHR(ch);
rb_secure(4);
GetOpenFile(io, fptr);
rb_io_check_writable(fptr);
f = GetWriteFile(fptr);
if (fputc(c, f) == EOF)
rb_sys_fail(fptr->path);
if (fptr->mode & FMODE_SYNC) {
io_fflush(f, fptr);
}
else {
fptr->mode |= FMODE_WBUF;
}
char c[2];
c[0] = NUM2CHR(ch);
c[1] = '\0';
rb_io_write(io, rb_str_new(c, 1));
return ch;
}

6
re.c
View file

@ -959,9 +959,6 @@ rb_reg_initialize(obj, s, len, options)
{
struct RRegexp *re = RREGEXP(obj);
if (OBJ_FROZEN(obj)) {
rb_error_frozen("Regexp");
}
if (re->ptr) re_free_pattern(re->ptr);
if (re->str) free(re->str);
re->ptr = 0;
@ -1161,6 +1158,9 @@ rb_reg_initialize_m(argc, argv, self)
}
}
if (OBJ_FROZEN(self)) {
rb_error_frozen("Regexp");
}
src = argv[0];
if (TYPE(src) == T_REGEXP) {
rb_reg_check(src);