mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* io.c (io_fflush): need to check if closed after thread switch.
[ruby-dev:20351] * io.c (fptr_finalize): ditto. * string.c (rb_str_rindex_m): fixed wrong fix. should move backward first only when matching from the end. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
894d2b643d
commit
7a425f71e3
3 changed files with 21 additions and 2 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
Fri Jun 27 03:24:54 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||
|
||||
* io.c (io_fflush): need to check if closed after thread switch.
|
||||
[ruby-dev:20351]
|
||||
|
||||
* io.c (fptr_finalize): ditto.
|
||||
|
||||
* string.c (rb_str_rindex_m): fixed wrong fix. should move backward
|
||||
first only when matching from the end.
|
||||
|
||||
Thu Jun 26 21:34:49 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||
|
||||
* class.c (class_instance_method_list): get rid of warning about
|
||||
|
|
6
io.c
6
io.c
|
@ -301,7 +301,9 @@ io_fflush(f, fptr)
|
|||
{
|
||||
int n;
|
||||
|
||||
rb_thread_fd_writable(fileno(f));
|
||||
if (!rb_thread_fd_writable(fileno(f))) {
|
||||
rb_io_check_closed(fptr);
|
||||
}
|
||||
for (;;) {
|
||||
TRAP_BEG;
|
||||
n = fflush(f);
|
||||
|
@ -1331,6 +1333,7 @@ fptr_finalize(fptr, noraise)
|
|||
e = errno;
|
||||
break;
|
||||
}
|
||||
if (!fptr->f2) break;
|
||||
}
|
||||
fptr->f2 = 0;
|
||||
}
|
||||
|
@ -1339,6 +1342,7 @@ fptr_finalize(fptr, noraise)
|
|||
while ((n1 = fclose(fptr->f)) < 0) {
|
||||
if (f2 != -1 || !(fptr->mode & FMODE_WBUF)) break;
|
||||
if (!rb_io_wait_writable(f1)) break;
|
||||
if (!fptr->f) break;
|
||||
}
|
||||
fptr->f = 0;
|
||||
if (n1 < 0 && errno == EBADF && f1 == f2) {
|
||||
|
|
7
string.c
7
string.c
|
@ -1010,8 +1010,13 @@ rb_str_rindex_m(argc, argv, str)
|
|||
char *p = RSTRING(str)->ptr + pos;
|
||||
char *pbeg = RSTRING(str)->ptr;
|
||||
|
||||
while (pbeg <= --p) {
|
||||
if (pos == RSTRING(str)->len) {
|
||||
if (pos == 0) return Qnil;
|
||||
--p;
|
||||
}
|
||||
while (pbeg <= p) {
|
||||
if (*p == c) return LONG2NUM(p - RSTRING(str)->ptr);
|
||||
p--;
|
||||
}
|
||||
return Qnil;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue