summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--compar.c9
-rw-r--r--configure.in5
-rw-r--r--dir.c5
-rw-r--r--ruby.h8
5 files changed, 24 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index ee3f30a..8560a71 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Jul 29 23:42:04 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * dir.c (dir_each): should check whether dir is closed during the
+ block execution. (ruby-bugs:#PR47)
+
Sat Jul 29 21:57:30 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
* ruby.c (rubylib_mangle): provide another buffer for the result.
diff --git a/compar.c b/compar.c
index 6971061..b21a83c 100644
--- a/compar.c
+++ b/compar.c
@@ -34,6 +34,13 @@ cmp_failed()
}
static VALUE
+cmp_eq2(a)
+ VALUE *a;
+{
+ return rb_rescue(cmp_eq, (VALUE)a, cmp_failed, 0);
+}
+
+static VALUE
cmp_equal(x, y)
VALUE x, y;
{
@@ -42,7 +49,7 @@ cmp_equal(x, y)
if (x == y) return Qtrue;
a[0] = x; a[1] = y;
- return rb_rescue(cmp_eq, (VALUE)a, cmp_failed, 0);
+ return rb_rescue2(cmp_eq2, (VALUE)a, rb_eScriptError, cmp_failed, 0);
}
static VALUE
diff --git a/configure.in b/configure.in
index 445e832..19aa49c 100644
--- a/configure.in
+++ b/configure.in
@@ -795,9 +795,12 @@ case "$target_os" in
openstep*)
CFLAGS="$CFLAGS -pipe"
;;
- rhasody*)
+ rhapsody*)
CFLAGS="$CFLAGS -pipe -no-precomp"
;;
+ os2_emx)
+ CFLAGS="$CFLAGS -DOS2"
+ ;;
osf*)
if test "$without_gcc" = "no" ; then
CFLAGS="$CFLAGS -ansi"
diff --git a/dir.c b/dir.c
index a3006f5..677250a 100644
--- a/dir.c
+++ b/dir.c
@@ -321,12 +321,11 @@ dir_each(dir)
{
DIR *dirp;
struct dirent *dp;
- VALUE file;
GetDIR(dir, dirp);
for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) {
- file = rb_tainted_str_new(dp->d_name, NAMLEN(dp));
- rb_yield(file);
+ rb_yield(rb_tainted_str_new(dp->d_name, NAMLEN(dp)));
+ if (DATA_PTR(dir) == NULL) dir_closed();
}
return dir;
}
diff --git a/ruby.h b/ruby.h
index 30c9ef8..9dd5f05 100644
--- a/ruby.h
+++ b/ruby.h
@@ -525,11 +525,8 @@ EXTERN VALUE rb_eEOFError;
EXTERN VALUE rb_eIndexError;
EXTERN VALUE rb_eRangeError;
EXTERN VALUE rb_eIOError;
-EXTERN VALUE rb_eLoadError;
-EXTERN VALUE rb_eNameError;
EXTERN VALUE rb_eRuntimeError;
EXTERN VALUE rb_eSecurityError;
-EXTERN VALUE rb_eSyntaxError;
EXTERN VALUE rb_eSystemCallError;
EXTERN VALUE rb_eTypeError;
EXTERN VALUE rb_eZeroDivError;
@@ -537,6 +534,11 @@ EXTERN VALUE rb_eNotImpError;
EXTERN VALUE rb_eNoMemError;
EXTERN VALUE rb_eFloatDomainError;
+EXTERN VALUE rb_eScriptError;
+EXTERN VALUE rb_eNameError;
+EXTERN VALUE rb_eSyntaxError;
+EXTERN VALUE rb_eLoadError;
+
#if defined(__GNUC__) && __GNUC__ >= 2 && !defined(RUBY_NO_INLINE)
extern __inline__ VALUE rb_class_of _((VALUE));
extern __inline__ int rb_type _((VALUE));