summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--io.c2
-rw-r--r--lib/complex.rb14
-rw-r--r--lib/jcode.rb8
4 files changed, 16 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 654e38d27c..95b485d6c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,10 @@ Sat Mar 22 12:44:15 2003 Tanaka Akira <akr@m17n.org>
* lib/date/format.rb, lib/uri/common.rb: `[', `]', `-' in chracter
class in regexp to avoid warning.
+Sat Mar 22 07:39:32 2003 Ulf Betlehem <flu@iki.fi>
+
+ * io.c (rb_io_fread): may lose data on nonblocking read.
+
Fri Mar 21 23:40:41 2003 Tanaka Akira <akr@m17n.org>
* regex.c (re_compile_pattern): fix previous change.
diff --git a/io.c b/io.c
index 5b9e095a58..674877c466 100644
--- a/io.c
+++ b/io.c
@@ -710,7 +710,7 @@ rb_io_fread(ptr, len, f)
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
case EWOULDBLOCK:
#endif
- if (len - n > 0) {
+ if (len - n >= 0) {
clearerr(f);
return len - n;
}
diff --git a/lib/complex.rb b/lib/complex.rb
index 98af310d3e..dda2ad2006 100644
--- a/lib/complex.rb
+++ b/lib/complex.rb
@@ -407,9 +407,7 @@ end
class Fixnum
- if not defined? Rational
- alias power! **
- end
+ alias power! **
# Redefined to handle a Complex argument.
def ** (other)
@@ -430,9 +428,7 @@ class Fixnum
end
class Bignum
- if not defined? Rational
- alias power! **
- end
+ alias power! **
end
class Float
@@ -459,7 +455,11 @@ module Math
Complex(0,sqrt!(-z))
end
else
- z**Rational(1,2)
+ if defined? Rational
+ z**Rational(1,2)
+ else
+ z**0.5
+ end
end
end
diff --git a/lib/jcode.rb b/lib/jcode.rb
index e0a2a99fce..ab6ab60701 100644
--- a/lib/jcode.rb
+++ b/lib/jcode.rb
@@ -59,13 +59,13 @@ class String
def end_regexp
case $KCODE[0]
when ?s, ?S
- /#{PATTERN_SJIS}$/o
+ /#{PATTERN_SJIS}$/on
when ?e, ?E
- /#{PATTERN_EUC}$/o
+ /#{PATTERN_EUC}$/on
when ?u, ?U
- /#{PATTERN_UTF8}$/o
+ /#{PATTERN_UTF8}$/on
else
- /.$/o
+ /.$/on
end
end