ruby-changes:10015
From: yugui <ko1@a...>
Date: Fri, 16 Jan 2009 00:39:32 +0900 (JST)
Subject: [ruby-changes:10015] Ruby:r21556 (ruby_1_9_1): merges r21503 from trunk into ruby_1_9_!.
yugui 2009-01-16 00:38:17 +0900 (Fri, 16 Jan 2009) New Revision: 21556 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21556 Log: merges r21503 from trunk into ruby_1_9_!. * io.c (appendline): reformed. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/io.c Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 21555) +++ ruby_1_9_1/ChangeLog (revision 21556) @@ -1,3 +1,9 @@ +Wed Jan 14 12:38:02 2009 Nobuyoshi Nakada <nobu@r...> + + * io.c (appendline): reformed. + + * io.c (rb_io_s_pipe): reduced nest of rb_ensure of main block. + Tue Jan 13 21:45:53 2009 Yuki Sonoda (Yugui) <yugui@y...> * lib/ostruct.rb (OpenStruct#inspect): fixed the recursion check. Index: ruby_1_9_1/io.c =================================================================== --- ruby_1_9_1/io.c (revision 21555) +++ ruby_1_9_1/io.c (revision 21556) @@ -2002,7 +2002,7 @@ if (NEED_READCONV(fptr)) { make_readconv(fptr, 0); - while (1) { + do { const char *p, *e; int searchlen; if (fptr->cbuf_len) { @@ -2036,15 +2036,12 @@ return (unsigned char)RSTRING_PTR(str)[RSTRING_LEN(str)-1]; } } - - if (more_char(fptr) == -1) { - *lp = limit; - return EOF; - } - } + } while (more_char(fptr) != -1); + *lp = limit; + return EOF; } - while (1) { + do { long pending = READ_DATA_PENDING_COUNT(fptr); if (pending > 0) { const char *p = READ_DATA_PENDING_PTR(fptr); @@ -2068,15 +2065,13 @@ *lp = limit; if (e) return delim; if (limit == 0) - return (unsigned char)RSTRING_PTR(str)[RSTRING_LEN(str)-1]; + return (unsigned char)RSTRING_PTR(str)[RSTRING_LEN(str)-1]; } rb_thread_wait_fd(fptr->fd); rb_io_check_closed(fptr); - if (io_fillbuf(fptr) < 0) { - *lp = limit; - return EOF; - } - } + } while (io_fillbuf(fptr) >= 0); + *lp = limit; + return EOF; } static inline int -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/