* io.c (appendline): initialize rslen to 1 if rsptr is 0.

rslen should be the length of the delimiter.
  if only delim is given, it should be 1.
  [ruby-dev:32746]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2007-12-25 06:38:00 +00:00
parent f46baadb56
commit 9f98c9a9c2
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,10 @@
Tue Dec 25 15:24:57 2007 Tanaka Akira <akr@fsij.org>
* io.c (appendline): initialize rslen to 1 if rsptr is 0.
rslen is the length of the delimiter.
if only delim is given, it should be 1.
[ruby-dev:32746]
Tue Dec 25 15:21:33 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* transcode.c (transcode_dispatch): fix for multistep transcode.

3
io.c
View File

@ -1672,6 +1672,9 @@ appendline(rb_io_t *fptr, int delim, const char *rsptr, int rslen, VALUE rs, VAL
long limit = *lp;
rb_encoding *enc = io_input_encoding(fptr);
if (rsptr == 0)
rslen = 1;
do {
long pending = READ_DATA_PENDING_COUNT(fptr);
if (pending > 0) {