mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* pack.c (pack_unpack): should treat 'U' in character unit, not in
byte unit. * error.c (exc_initialize): should clear backtrace information. * io.c (rb_io_fptr_cleanup): should close IO created by IO.new(fd). * rubyio.h: remove FMODE_FDOPEN git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cb944528b6
commit
9a24232fd2
7 changed files with 18 additions and 13 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
Mon Apr 15 09:27:31 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* pack.c (pack_unpack): should treat 'U' in character unit, not in
|
||||
byte unit.
|
||||
|
||||
* error.c (exc_initialize): should clear backtrace information.
|
||||
|
||||
Sat Apr 13 23:42:43 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* io.c (rb_io_fptr_cleanup): should close IO created by IO.new(fd).
|
||||
|
||||
* rubyio.h: remove FMODE_FDOPEN
|
||||
|
||||
Fri Apr 12 12:54:04 2002 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* win32/Makefile.sub: use missing/acosh.c.
|
||||
|
|
1
error.c
1
error.c
|
@ -309,6 +309,7 @@ exc_initialize(argc, argv, exc)
|
|||
StringValue(mesg); /* ensure mesg can be converted to String */
|
||||
}
|
||||
rb_iv_set(exc, "mesg", mesg);
|
||||
rb_iv_set(exc, "bt", Qnil);
|
||||
|
||||
return exc;
|
||||
}
|
||||
|
|
3
eval.c
3
eval.c
|
@ -5049,14 +5049,13 @@ eval(self, src, scope, file, line)
|
|||
if (strcmp(file, "(eval)") == 0) {
|
||||
if (ruby_sourceline > 1) {
|
||||
errat = get_backtrace(ruby_errinfo);
|
||||
err = RARRAY(errat)->ptr[0];
|
||||
err = rb_str_dup(RARRAY(errat)->ptr[0]);
|
||||
rb_str_cat2(err, ": ");
|
||||
rb_str_append(err, ruby_errinfo);
|
||||
}
|
||||
else {
|
||||
err = rb_str_dup(ruby_errinfo);
|
||||
}
|
||||
errat = Qnil;
|
||||
rb_exc_raise(rb_funcall(ruby_errinfo, rb_intern("exception"), 1, err));
|
||||
}
|
||||
rb_exc_raise(ruby_errinfo);
|
||||
|
|
|
@ -202,7 +202,6 @@ bsock_s_for_fd(klass, fd)
|
|||
VALUE sock = init_sock(rb_obj_alloc(klass), NUM2INT(fd));
|
||||
|
||||
GetOpenFile(sock, fptr);
|
||||
fptr->mode |= FMODE_FDOPEN;
|
||||
|
||||
return sock;
|
||||
}
|
||||
|
|
8
io.c
8
io.c
|
@ -1191,12 +1191,6 @@ rb_io_fptr_cleanup(fptr, fin)
|
|||
OpenFile *fptr;
|
||||
int fin;
|
||||
{
|
||||
if (fptr->mode & FMODE_FDOPEN) {
|
||||
if (fptr->mode & FMODE_WRITABLE) {
|
||||
io_fflush(GetWriteFile(fptr), fptr);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (fptr->finalize) {
|
||||
(*fptr->finalize)(fptr);
|
||||
}
|
||||
|
@ -2621,7 +2615,7 @@ rb_io_initialize(argc, argv, io)
|
|||
#endif
|
||||
}
|
||||
MakeOpenFile(io, fp);
|
||||
fp->mode = rb_io_modenum_flags(flags) | FMODE_FDOPEN;
|
||||
fp->mode = rb_io_modenum_flags(flags);
|
||||
fp->f = rb_fdopen(fd, rb_io_modenum_mode(flags, mbuf));
|
||||
|
||||
return io;
|
||||
|
|
4
pack.c
4
pack.c
|
@ -1468,11 +1468,11 @@ pack_unpack(str, fmt)
|
|||
case 'U':
|
||||
if (len > send - s) len = send - s;
|
||||
while (len > 0 && s < send) {
|
||||
int alen = len;
|
||||
int alen = send - s;
|
||||
unsigned long l;
|
||||
|
||||
l = utf8_to_uv(s, &alen);
|
||||
s += alen; len -= alen;
|
||||
s += alen; len--;
|
||||
rb_ary_push(ary, rb_uint2inum(l));
|
||||
}
|
||||
break;
|
||||
|
|
1
rubyio.h
1
rubyio.h
|
@ -32,7 +32,6 @@ typedef struct OpenFile {
|
|||
#define FMODE_BINMODE 4
|
||||
#define FMODE_SYNC 8
|
||||
#define FMODE_WBUF 16
|
||||
#define FMODE_FDOPEN 32
|
||||
|
||||
#define GetOpenFile(obj,fp) rb_io_check_closed((fp) = RFILE(rb_io_taint_check(obj))->fptr)
|
||||
|
||||
|
|
Loading…
Reference in a new issue