summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-25 06:20:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-25 06:20:48 +0000
commitb9a4f78d6f4ea5696a99e43f431caf0070933bad (patch)
treec4155474f3afe450ed6cda93653df3931f2cd9d9
parent2490412a31999b0dc7478ed731543080ee957493 (diff)
downloadruby-b9a4f78d6f4ea5696a99e43f431caf0070933bad.tar.gz
ruby-b9a4f78d6f4ea5696a99e43f431caf0070933bad.tar.xz
ruby-b9a4f78d6f4ea5696a99e43f431caf0070933bad.zip
* io.c (swallow): removed condition using an unset variable.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--io.c16
2 files changed, 13 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 30dbd4585..8a0971a18 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/io.c b/io.c
index e9fd2a0b0..d1b8eee15 100644
--- a/io.c
+++ b/io.c
@@ -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;