diff --git a/ChangeLog b/ChangeLog index 3942ac876b..4603026bcc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,18 @@ -Wed Sep 13 17:11:19 2000 Yukihiro Matsumoto +Mon Sep 18 17:46:11 2000 Yukihiro Matsumoto * stable version 1.6.0 released. +Sat Sep 16 03:29:59 2000 Yukihiro Matsumoto + + * eval.c (rb_f_require): rb_provided() called too early; does not + work well with threads. + + * parse.y (ensure): should distinguish empty ensure and non + existing ensure. + + * file.c (Init_File): extending File by class of FileTest was + serious mistake. + Thu Sep 14 02:46:54 2000 Yukihiro Matsumoto * eval.c (rb_thread_yield): array strip should be done in this diff --git a/eval.c b/eval.c index f396638013..31270be266 100644 --- a/eval.c +++ b/eval.c @@ -5074,8 +5074,6 @@ rb_f_require(obj, fname) volatile int safe = ruby_safe_level; Check_SafeStr(fname); - if (rb_provided(RSTRING(fname)->ptr)) return Qfalse; - ext = strrchr(RSTRING(fname)->ptr, '.'); if (ext) { if (strcmp(".rb", ext) == 0) { diff --git a/file.c b/file.c index 5c4dcaec01..00f4f2c15b 100644 --- a/file.c +++ b/file.c @@ -2153,40 +2153,47 @@ rb_find_file(file) return 0; } -void +static void +define_filetest_function(name, func, argc) + const char *name; + VALUE (*func)(); + int argc; +{ + rb_define_module_function(rb_mFileTest, name, func, argc); + rb_define_singleton_method(rb_cFile, name, func, argc); +} + Init_File() { rb_mFileTest = rb_define_module("FileTest"); - - rb_define_module_function(rb_mFileTest, "directory?", test_d, 1); - rb_define_module_function(rb_mFileTest, "exist?", test_e, 1); - rb_define_module_function(rb_mFileTest, "exists?", test_e, 1); /* temporary */ - rb_define_module_function(rb_mFileTest, "readable?", test_r, 1); - rb_define_module_function(rb_mFileTest, "readable_real?", test_R, 1); - rb_define_module_function(rb_mFileTest, "writable?", test_w, 1); - rb_define_module_function(rb_mFileTest, "writable_real?", test_W, 1); - rb_define_module_function(rb_mFileTest, "executable?", test_x, 1); - rb_define_module_function(rb_mFileTest, "executable_real?", test_X, 1); - rb_define_module_function(rb_mFileTest, "file?", test_f, 1); - rb_define_module_function(rb_mFileTest, "zero?", test_z, 1); - rb_define_module_function(rb_mFileTest, "size?", test_s, 1); - rb_define_module_function(rb_mFileTest, "size", test_s, 1); - rb_define_module_function(rb_mFileTest, "owned?", test_owned, 1); - rb_define_module_function(rb_mFileTest, "grpowned?", test_grpowned, 1); - - rb_define_module_function(rb_mFileTest, "pipe?", test_p, 1); - rb_define_module_function(rb_mFileTest, "symlink?", test_l, 1); - rb_define_module_function(rb_mFileTest, "socket?", test_S, 1); - - rb_define_module_function(rb_mFileTest, "blockdev?", test_b, 1); - rb_define_module_function(rb_mFileTest, "chardev?", test_c, 1); - - rb_define_module_function(rb_mFileTest, "setuid?", test_suid, 1); - rb_define_module_function(rb_mFileTest, "setgid?", test_sgid, 1); - rb_define_module_function(rb_mFileTest, "sticky?", test_sticky, 1); - rb_cFile = rb_define_class("File", rb_cIO); - rb_extend_object(rb_cFile, CLASS_OF(rb_mFileTest)); + + define_filetest_function("directory?", test_d, 1); + define_filetest_function("exist?", test_e, 1); + define_filetest_function("exists?", test_e, 1); /* temporary */ + define_filetest_function("readable?", test_r, 1); + define_filetest_function("readable_real?", test_R, 1); + define_filetest_function("writable?", test_w, 1); + define_filetest_function("writable_real?", test_W, 1); + define_filetest_function("executable?", test_x, 1); + define_filetest_function("executable_real?", test_X, 1); + define_filetest_function("file?", test_f, 1); + define_filetest_function("zero?", test_z, 1); + define_filetest_function("size?", test_s, 1); + define_filetest_function("size", test_s, 1); + define_filetest_function("owned?", test_owned, 1); + define_filetest_function("grpowned?", test_grpowned, 1); + + define_filetest_function("pipe?", test_p, 1); + define_filetest_function("symlink?", test_l, 1); + define_filetest_function("socket?", test_S, 1); + + define_filetest_function("blockdev?", test_b, 1); + define_filetest_function("chardev?", test_c, 1); + + define_filetest_function("setuid?", test_suid, 1); + define_filetest_function("setgid?", test_sgid, 1); + define_filetest_function("sticky?", test_sticky, 1); rb_define_singleton_method(rb_cFile, "stat", rb_file_s_stat, 1); rb_define_singleton_method(rb_cFile, "lstat", rb_file_s_lstat, 1); diff --git a/parse.y b/parse.y index 3a273da94e..39ac6f6f60 100644 --- a/parse.y +++ b/parse.y @@ -1507,7 +1507,11 @@ rescue : kRESCUE exc_list exc_var then ensure : none | kENSURE compstmt { - $$ = $2; + if ($2) + $$ = $2; + else + /* place holder */ + $$ = NEW_NIL(); } literal : numeric diff --git a/version.h b/version.h index 09edb15a5b..12b6097c31 100644 --- a/version.h +++ b/version.h @@ -1,4 +1,4 @@ #define RUBY_VERSION "1.6.0" -#define RUBY_RELEASE_DATE "2000-09-12" +#define RUBY_RELEASE_DATE "2000-09-18" #define RUBY_VERSION_CODE 160 -#define RUBY_RELEASE_CODE 20000912 +#define RUBY_RELEASE_CODE 20000918