* io.c (appendline): file may not end with newline. a bug if
READ_DATA_PENDING_PTR is defined. [ruby-talk:84925] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4c5094d65d
commit
2c1140b3e0
@ -1,3 +1,8 @@
|
|||||||
|
Tue Nov 11 22:44:08 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* io.c (appendline): file may not end with newline. a bug if
|
||||||
|
READ_DATA_PENDING_PTR is defined. [ruby-talk:84925]
|
||||||
|
|
||||||
Tue Nov 11 10:42:41 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
Tue Nov 11 10:42:41 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||||
|
|
||||||
* ext/tk/lib/tk.rb: raise an exception when creating TkWindow
|
* ext/tk/lib/tk.rb: raise an exception when creating TkWindow
|
||||||
|
14
io.c
14
io.c
@ -873,7 +873,7 @@ appendline(fptr, delim, strp)
|
|||||||
#ifndef READ_DATA_PENDING_PTR
|
#ifndef READ_DATA_PENDING_PTR
|
||||||
char buf[8192];
|
char buf[8192];
|
||||||
char *bp = buf, *bpe = buf + sizeof buf - 3;
|
char *bp = buf, *bpe = buf + sizeof buf - 3;
|
||||||
int cnt;
|
int update = Qfalse;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@ -925,11 +925,13 @@ appendline(fptr, delim, strp)
|
|||||||
rb_sys_fail(fptr->path);
|
rb_sys_fail(fptr->path);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
#ifdef READ_DATA_PENDING_PTR
|
||||||
return c;
|
return c;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#ifndef READ_DATA_PENDING_PTR
|
#ifndef READ_DATA_PENDING_PTR
|
||||||
if ((*bp++ = c) == delim || bp == bpe) {
|
if (c == EOF || (*bp++ = c) == delim || bp == bpe) {
|
||||||
cnt = bp - buf;
|
int cnt = bp - buf;
|
||||||
|
|
||||||
if (cnt > 0) {
|
if (cnt > 0) {
|
||||||
if (!NIL_P(str))
|
if (!NIL_P(str))
|
||||||
@ -937,8 +939,14 @@ appendline(fptr, delim, strp)
|
|||||||
else
|
else
|
||||||
*strp = str = rb_str_new(buf, cnt);
|
*strp = str = rb_str_new(buf, cnt);
|
||||||
}
|
}
|
||||||
|
if (c == EOF) {
|
||||||
|
if (update)
|
||||||
|
return (int)RSTRING(str)->ptr[RSTRING(str)->len-1];
|
||||||
|
return c;
|
||||||
|
}
|
||||||
bp = buf;
|
bp = buf;
|
||||||
}
|
}
|
||||||
|
update = Qtrue;
|
||||||
#endif
|
#endif
|
||||||
} while (c != delim);
|
} while (c != delim);
|
||||||
|
|
||||||
|
@ -1295,7 +1295,6 @@ module DRb
|
|||||||
end
|
end
|
||||||
|
|
||||||
def run
|
def run
|
||||||
raise if Thread.critical
|
|
||||||
Thread.start do
|
Thread.start do
|
||||||
begin
|
begin
|
||||||
while true
|
while true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user