Skip to content

Commit a4934a4

Browse files
author
matz
committed
* io.c (read_all): fptr->f may be NULL, if IO is closed in the
signal handler. * io.c (io_read): ditto. * string.c (get_pat): remove 1.8.0 warning code. * string.c (rb_str_match): extend warning until 1.8.2. * string.c (rb_str_match2): ditto. * class.c (class_instance_method_list): remove 1.8.0 warnings. method_list now recurs. [ruby-dev:21816] * class.c (rb_obj_singleton_methods): ditto. * array.c (rb_ary_select): remove select with block. [ruby-dev:21824] * hash.c (rb_hash_select): ditto. * hash.c (env_select): ditto. * re.c (match_select): ditto. * struct.c (rb_struct_select): ditto. * process.c (check_uid_switch): remove duplicated error messages. * process.c (check_gid_switch): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 89d1dff commit a4934a4

File tree

13 files changed

+92
-151
lines changed

13 files changed

+92
-151
lines changed

ChangeLog

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
Tue Nov 4 06:54:52 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
2+
3+
* io.c (read_all): fptr->f may be NULL, if IO is closed in the
4+
signal handler.
5+
6+
* io.c (io_read): ditto.
7+
8+
* string.c (get_pat): remove 1.8.0 warning code.
9+
10+
* string.c (rb_str_match): extend warning until 1.8.2.
11+
12+
* string.c (rb_str_match2): ditto.
13+
14+
* class.c (class_instance_method_list): remove 1.8.0 warnings.
15+
method_list now recurs. [ruby-dev:21816]
16+
17+
* class.c (rb_obj_singleton_methods): ditto.
18+
19+
* array.c (rb_ary_select): remove select with block.
20+
[ruby-dev:21824]
21+
22+
* hash.c (rb_hash_select): ditto.
23+
24+
* hash.c (env_select): ditto.
25+
26+
* re.c (match_select): ditto.
27+
28+
* struct.c (rb_struct_select): ditto.
29+
130
Mon Nov 3 22:53:21 2003 Minero Aoki <aamine@loveruby.net>
231

332
* lib/racc/parser.rb: synchronize with Racc 1.4.4.
@@ -7,6 +36,12 @@ Mon Nov 3 22:53:21 2003 Minero Aoki <aamine@loveruby.net>
736
* ext/racc/cparse/cparse.c (parse_main): should abort when
837
the length of LR state stack <=1, not ==0.
938

39+
Mon Nov 3 08:50:47 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
40+
41+
* process.c (check_uid_switch): remove duplicated error messages.
42+
43+
* process.c (check_gid_switch): ditto.
44+
1045
Sun Nov 2 02:28:33 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
1146

1247
* lib/webrick/ssl.rb: new option :SSLExtraChainCert.

MANIFEST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ lib/test/unit/ui/fox/testrunner.rb
342342
lib/test/unit/ui/gtk/testrunner.rb
343343
lib/test/unit/ui/testrunnermediator.rb
344344
lib/test/unit/ui/testrunnerutilities.rb
345+
lib/test/unit/ui/tk/testrunner.rb
345346
lib/test/unit/util/backtracefilter.rb
346347
lib/test/unit/util/observable.rb
347348
lib/test/unit/util/procwrapper.rb

array.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ rb_ary_initialize(argc, argv, ary)
254254
if (rb_block_given_p()) {
255255
long i;
256256

257-
if (argc > 1) {
258-
rb_raise(rb_eArgError, "wrong number of arguments");
257+
if (argc == 2) {
258+
rb_warn("block supersedes default value argument");
259259
}
260260
for (i=0; i<len; i++) {
261261
RARRAY(ary)->ptr[i] = rb_yield(LONG2NUM(i));
@@ -655,8 +655,7 @@ rb_ary_indexes(argc, argv, ary)
655655
VALUE new_ary;
656656
long i;
657657

658-
rb_warn("Array#%s is deprecated; use Array#values_at",
659-
rb_id2name(rb_frame_last_func()));
658+
rb_warn("Array#%s is deprecated; use Array#values_at", rb_id2name(rb_frame_last_func()));
660659
new_ary = rb_ary_new2(argc);
661660
for (i=0; i<argc; i++) {
662661
rb_ary_push(new_ary, rb_ary_aref(1, argv+i, ary));
@@ -1270,10 +1269,6 @@ rb_ary_select(argc, argv, ary)
12701269
VALUE result;
12711270
long i;
12721271

1273-
if (!rb_block_given_p()) {
1274-
rb_warn("Array#select(index..) is deprecated; use Array#values_at");
1275-
return rb_ary_values_at(argc, argv, ary);
1276-
}
12771272
if (argc > 0) {
12781273
rb_raise(rb_eArgError, "wrong number arguments (%d for 0)", argc);
12791274
}

class.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -539,12 +539,7 @@ class_instance_method_list(argc, argv, mod, func)
539539
st_table *list;
540540

541541
if (argc == 0) {
542-
#if RUBY_VERSION_CODE < 181
543-
rb_warn("%s: parameter will default to 'true' as of 1.8.1", rb_id2name(rb_frame_last_func()));
544-
recur = Qfalse;
545-
#else
546542
recur = Qtrue;
547-
#endif
548543
}
549544
else {
550545
VALUE r;
@@ -613,11 +608,7 @@ rb_obj_singleton_methods(argc, argv, obj)
613608

614609
rb_scan_args(argc, argv, "01", &recur);
615610
if (argc == 0) {
616-
#if RUBY_VERSION_CODE < 181
617-
rb_warn("singleton_methods: parameter will default to 'true' as of 1.8.1");
618-
#else
619611
recur = Qtrue;
620-
#endif
621612
}
622613
klass = CLASS_OF(obj);
623614
list = st_init_numtable();

error.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ name_err_initialize(argc, argv, self)
480480
VALUE self;
481481
{
482482
VALUE name = (argc > 1) ? argv[--argc] : Qnil;
483+
483484
exc_initialize(argc, argv, self);
484485
rb_iv_set(self, "name", name);
485486
return self;

eval.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4727,7 +4727,6 @@ rb_method_missing(argc, argv, obj)
47274727

47284728
id = SYM2ID(argv[0]);
47294729

4730-
47314730
switch (TYPE(obj)) {
47324731
case T_NIL:
47334732
desc = "nil";

file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ rb_file_path(obj)
9999

100100
fptr = RFILE(rb_io_taint_check(obj))->fptr;
101101
if (!fptr->path) return Qnil;
102-
return rb_str_new2(fptr->path);
102+
return rb_tainted_str_new2(fptr->path);
103103
}
104104

105105
static VALUE

hash.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -529,12 +529,6 @@ rb_hash_select(argc, argv, hash)
529529
{
530530
VALUE result;
531531

532-
if (!rb_block_given_p()) {
533-
#if RUBY_VERSION_CODE < 181
534-
rb_warn("Hash#select(key..) is deprecated; use Hash#values_at");
535-
#endif
536-
return rb_hash_values_at(argc, argv, hash);
537-
}
538532
if (argc > 0) {
539533
rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
540534
}
@@ -1454,10 +1448,6 @@ env_select(argc, argv)
14541448
VALUE result;
14551449
char **env;
14561450

1457-
if (!rb_block_given_p()) {
1458-
rb_warn("ENV.select(index..) is deprecated; use ENV.values_at");
1459-
return env_values_at(argc, argv);
1460-
}
14611451
if (argc > 0) {
14621452
rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
14631453
}

io.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,7 @@ read_all(fptr, siz, str)
790790
n = rb_io_fread(RSTRING(str)->ptr+bytes, siz-bytes, fptr->f);
791791
if (pos > 0 && n == 0 && bytes == 0) {
792792
rb_str_resize(str,0);
793+
if (!fptr->f) return Qnil;
793794
if (feof(fptr->f)) return Qnil;
794795
if (!ferror(fptr->f)) return str;
795796
rb_sys_fail(fptr->path);
@@ -843,6 +844,7 @@ io_read(argc, argv, io)
843844
n = rb_io_fread(RSTRING(str)->ptr, len, fptr->f);
844845
if (n == 0) {
845846
rb_str_resize(str,0);
847+
if (!fptr->f) return Qnil;
846848
if (feof(fptr->f)) return Qnil;
847849
if (len > 0) rb_sys_fail(fptr->path);
848850
}

0 commit comments

Comments
 (0)