summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-07-07 03:20:53 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-07-07 03:20:53 +0000
commit3043170b14875ce53f3a951d665279b12c2c63a8 (patch)
tree5903ff25972c6d5399725ec7ad14fe25df9026f6
parent1ec4d9d3e47132a4eeacc1a45a9e0bf1159ab3c8 (diff)
downloadruby-3043170b14875ce53f3a951d665279b12c2c63a8.tar.gz
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog25
-rw-r--r--README.EXT10
-rw-r--r--README.EXT.jp11
-rw-r--r--ToDo2
-rw-r--r--numeric.c2
-rw-r--r--parse.y9
-rw-r--r--ruby.c3
-rw-r--r--time.c11
8 files changed, 58 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 6c87b9e4ba..06d8047f6d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,27 @@
+Fri Jul 7 03:30:00 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * parse.y (aref_args): should allow Hash[:a=>2] etc.
+
+ * numeric.c (fix_aref): convert index by NUM2INT, not FIX2INT.
+ (ruby-bugs:#PR37)
+
+ * time.c (time_localtime): should prohibit for frozen time.
+
+ * time.c (time_gmtime): ditto.
+
+Thu Jul 6 19:12:12 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * io.c (rb_file_s_open): should not terminate fptr; just clear it.
+
+ * ruby.c (proc_options): should not call require_libraries()
+ twice.
+
+ * ruby.c (require_libraries): clear req_list_head.next after
+ execution.
+
Thu Jul 6 13:51:57 2000 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
- * object.c (rb_to_id): name may not be symbol or fixnum.
+ * object.c (rb_to_id): name may not be symbol nor fixnum.
* struct.c (rb_struct_s_def): name may be nil.
@@ -40,7 +61,7 @@ Wed Jul 5 09:47:14 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* io.c (rb_io_reopen): clear fptr->path after free() to prevent
potential GC crash.
- * io.c (rb_file_s_open): terminate fptr uless null.
+ * io.c (rb_file_s_open): terminate fptr unless null.
* io.c (rb_file_initialize): ditto.
diff --git a/README.EXT b/README.EXT
index 90673661e9..dc5126efaf 100644
--- a/README.EXT
+++ b/README.EXT
@@ -585,7 +585,7 @@ at the top of the file. You can use the functions below to check the
condition.
have_library(lib, func): check whether library containing function exists.
- have_func(func): check whether function exists
+ have_func(func, header): check whether function exists
have_header(header): check whether header file exists
create_makefile(target): generate Makefile
@@ -975,11 +975,11 @@ These functions are available in extconf.rb:
Checks whether library which contains specified function exists.
Returns true if the library exists.
- have_func(func)
+ have_func(func, header)
-Checks whether func exists. Returns true if the function exists. To
-check functions in the additional library, you need to check that
-library first using have_library().
+Checks whether func exists with header. Returns true if the function
+exists. To check functions in the additional library, you need to
+check that library first using have_library().
have_header(header)
diff --git a/README.EXT.jp b/README.EXT.jp
index 419d7e37a7..ac4f3adca9 100644
--- a/README.EXT.jp
+++ b/README.EXT.jp
@@ -694,7 +694,7 @@ Makefileを作る場合の雛型になるextconf.rbというファイルを作り
数を使うことが出来ます.
have_library(lib, func): ライブラリの存在チェック
- have_func(func): 関数の存在チェック
+ have_func(func, header): 関数の存在チェック
have_header(header): ヘッダファイルの存在チェック
create_makefile(target): Makefileの生成
@@ -1134,11 +1134,12 @@ find_library(lib, func, path...)
関数funcを定義しているライブラリlibの存在を -Lpath を追加
しながらチェックする.ライブラリが見付かった時,trueを返す.
-have_func(func)
+have_func(func, header)
- 関数funcの存在をチェックする.funcが標準ではリンクされない
- ライブラリ内のものである時には先にhave_libraryでそのライブ
- ラリをチェックしておく事.関数が存在する時trueを返す.
+ ヘッダファイルheaderをインクルードして関数funcの存在をチェッ
+ クする.funcが標準ではリンクされないライブラリ内のものであ
+ る時には先にhave_libraryでそのライブラリをチェックしておく
+ 事.関数が存在する時trueを返す.
have_header(header)
diff --git a/ToDo b/ToDo
index 297e6e231d..05cec797e2 100644
--- a/ToDo
+++ b/ToDo
@@ -6,7 +6,7 @@ Language Spec.
- %w(a\ b\ c abc) => ["a b c", "abc"]
- objectify symbols
- class variable (prefix @@)
-- rescue RuntimeError =>n err
+- rescue RuntimeError => err
* operator !! for rescue. ???
* objectify characters
* ../... outside condition invokes operator method too.
diff --git a/numeric.c b/numeric.c
index b051c4c105..3c68917be8 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1314,7 +1314,7 @@ fix_aref(fix, idx)
VALUE fix, idx;
{
unsigned long val = FIX2LONG(fix);
- int i = FIX2LONG(idx);
+ int i = NUM2INT(idx);
if (i < 0 || sizeof(VALUE)*CHAR_BIT-1 < i)
return INT2FIX(0);
diff --git a/parse.y b/parse.y
index 460e05508f..615519a908 100644
--- a/parse.y
+++ b/parse.y
@@ -862,6 +862,14 @@ aref_args : none
value_expr($4);
$$ = arg_concat($1, $4);
}
+ | assocs
+ {
+ $$ = NEW_LIST(NEW_HASH($1));
+ }
+ | assocs ','
+ {
+ $$ = NEW_LIST(NEW_HASH($1));
+ }
| tSTAR arg opt_nl
{
value_expr($2);
@@ -3381,6 +3389,7 @@ yylex()
tokadd(c);
tokfix();
yylval.id = rb_intern(tok());
+ /* xxx shouldn't check if valid option variable */
return tGVAR;
case '&': /* $&: last match */
diff --git a/ruby.c b/ruby.c
index d848160c6f..783695ef97 100644
--- a/ruby.c
+++ b/ruby.c
@@ -255,6 +255,7 @@ require_libraries()
free(list);
list = tmp;
}
+ req_list_head.next = 0;
ruby_eval_tree = save[0];
ruby_eval_tree_begin = save[1];
ruby_sourcefile = orig_sourcefile;
@@ -638,7 +639,6 @@ proc_options(argc, argv)
rb_compile_string(script, e_script, 1);
}
else if (strlen(script) == 1 && script[0] == '-') {
- require_libraries();
load_stdin();
}
else {
@@ -925,6 +925,7 @@ ruby_prog_init()
ruby_sourcefile = "ruby";
rb_define_variable("$VERBOSE", &ruby_verbose);
rb_define_variable("$-v", &ruby_verbose);
+ rb_define_variable("$-w", &ruby_verbose);
rb_define_variable("$DEBUG", &ruby_debug);
rb_define_variable("$-d", &ruby_debug);
rb_define_readonly_variable("$-p", &do_print);
diff --git a/time.c b/time.c
index 77257eb030..32b3f0b794 100644
--- a/time.c
+++ b/time.c
@@ -535,6 +535,15 @@ time_clone(time)
return clone;
}
+static void
+time_modify(time)
+ VALUE time;
+{
+ if (OBJ_FROZEN(time)) rb_error_frozen("Time");
+ if (!OBJ_TAINTED(time) && rb_safe_level() >= 4)
+ rb_raise(rb_eSecurityError, "Insecure: can't modify Time");
+}
+
static VALUE
time_localtime(time)
VALUE time;
@@ -547,6 +556,7 @@ time_localtime(time)
if (tobj->tm_got && !tobj->gmt) {
return time;
}
+ time_modify(time);
t = tobj->tv.tv_sec;
tm_tmp = localtime(&t);
tobj->tm = *tm_tmp;
@@ -567,6 +577,7 @@ time_gmtime(time)
if (tobj->tm_got && tobj->gmt) {
return time;
}
+ time_modify(time);
t = tobj->tv.tv_sec;
tm_tmp = gmtime(&t);
tobj->tm = *tm_tmp;