diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-07-31 04:36:38 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-07-31 04:36:38 +0000 |
| commit | cf97cd57b9aa26b1aa80bd7e91bbe4745a8301d0 (patch) | |
| tree | 63f3802266420dcfeef1b188f644946650d7746c /dir.c | |
| parent | b8a15e5908eacab55d6f69f2a5049ae42e210689 (diff) | |
| download | ruby-cf97cd57b9aa26b1aa80bd7e91bbe4745a8301d0.tar.gz ruby-cf97cd57b9aa26b1aa80bd7e91bbe4745a8301d0.tar.xz ruby-cf97cd57b9aa26b1aa80bd7e91bbe4745a8301d0.zip | |
matz
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
| -rw-r--r-- | dir.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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; } |
