diff --git a/ChangeLog b/ChangeLog index 30dbd45853..8a0971a181 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Aug 25 15:20:46 2007 Nobuyoshi Nakada + + * io.c (swallow): removed condition using an unset variable. + Sat Aug 25 11:45:37 2007 Yukihiro Matsumoto * encoding.c: provide basic features for M17N. diff --git a/io.c b/io.c index e9fd2a0b07..d1b8eee15c 100644 --- a/io.c +++ b/io.c @@ -18,6 +18,10 @@ #include #include +#if defined(DOSISH) || defined(__CYGWIN__) +#include +#endif + #include #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;