diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-25 06:20:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-25 06:20:48 +0000 |
commit | 8bbac3ba77bb8261563b62bc709fc05759eea20a (patch) | |
tree | c4155474f3afe450ed6cda93653df3931f2cd9d9 | |
parent | 000b6e22f463c560f695b460272395a492eface5 (diff) | |
download | ruby-8bbac3ba77bb8261563b62bc709fc05759eea20a.tar.gz |
* io.c (swallow): removed condition using an unset variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | io.c | 16 |
2 files changed, 13 insertions, 7 deletions
@@ -1,3 +1,7 @@ +Sat Aug 25 15:20:46 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * io.c (swallow): removed condition using an unset variable. + Sat Aug 25 11:45:37 2007 Yukihiro Matsumoto <matz@ruby-lang.org> * encoding.c: provide basic features for M17N. @@ -18,6 +18,10 @@ #include <ctype.h> #include <errno.h> +#if defined(DOSISH) || defined(__CYGWIN__) +#include <io.h> +#endif + #include <sys/types.h> #if !defined(_WIN32) && !defined(__DJGPP__) # if defined(__BEOS__) @@ -1616,8 +1620,6 @@ appendline(rb_io_t *fptr, int delim, VALUE *strp, long *lp) static inline int swallow(rb_io_t *fptr, int term) { - int c; - do { long cnt; while ((cnt = READ_DATA_PENDING_COUNT(fptr)) > 0) { @@ -1633,10 +1635,7 @@ swallow(rb_io_t *fptr, int term) } rb_thread_wait_fd(fptr->fd); rb_io_check_closed(fptr); - if (io_fillbuf(fptr) < 0) { - break; - } - } while (c != EOF); + } while (io_fillbuf(fptr) == 0); return Qfalse; } @@ -4435,7 +4434,10 @@ next_argv(void) int fr = rb_sysopen(fn, O_RDONLY, 0); if (ruby_inplace_mode) { - struct stat st, st2; + struct stat st; +#ifndef NO_SAFE_RENAME + struct stat st2; +#endif VALUE str; int fw; |