Skip to content

Commit

Permalink
* io.c (read_all): fptr->f may be NULL, if IO is closed in the
Browse files Browse the repository at this point in the history
  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
  • Loading branch information
matz committed Nov 4, 2003
1 parent 89d1dff commit a4934a4
Show file tree
Hide file tree
Showing 13 changed files with 92 additions and 151 deletions.
35 changes: 35 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
Tue Nov 4 06:54:52 2003 Yukihiro Matsumoto <matz@ruby-lang.org>

* 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.

Mon Nov 3 22:53:21 2003 Minero Aoki <aamine@loveruby.net>

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

Mon Nov 3 08:50:47 2003 Yukihiro Matsumoto <matz@ruby-lang.org>

* process.c (check_uid_switch): remove duplicated error messages.

* process.c (check_gid_switch): ditto.

Sun Nov 2 02:28:33 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>

* lib/webrick/ssl.rb: new option :SSLExtraChainCert.
Expand Down
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ lib/test/unit/ui/fox/testrunner.rb
lib/test/unit/ui/gtk/testrunner.rb
lib/test/unit/ui/testrunnermediator.rb
lib/test/unit/ui/testrunnerutilities.rb
lib/test/unit/ui/tk/testrunner.rb
lib/test/unit/util/backtracefilter.rb
lib/test/unit/util/observable.rb
lib/test/unit/util/procwrapper.rb
Expand Down
11 changes: 3 additions & 8 deletions array.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ rb_ary_initialize(argc, argv, ary)
if (rb_block_given_p()) {
long i;

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

rb_warn("Array#%s is deprecated; use Array#values_at",
rb_id2name(rb_frame_last_func()));
rb_warn("Array#%s is deprecated; use Array#values_at", rb_id2name(rb_frame_last_func()));
new_ary = rb_ary_new2(argc);
for (i=0; i<argc; i++) {
rb_ary_push(new_ary, rb_ary_aref(1, argv+i, ary));
Expand Down Expand Up @@ -1270,10 +1269,6 @@ rb_ary_select(argc, argv, ary)
VALUE result;
long i;

if (!rb_block_given_p()) {
rb_warn("Array#select(index..) is deprecated; use Array#values_at");
return rb_ary_values_at(argc, argv, ary);
}
if (argc > 0) {
rb_raise(rb_eArgError, "wrong number arguments (%d for 0)", argc);
}
Expand Down
9 changes: 0 additions & 9 deletions class.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,12 +539,7 @@ class_instance_method_list(argc, argv, mod, func)
st_table *list;

if (argc == 0) {
#if RUBY_VERSION_CODE < 181
rb_warn("%s: parameter will default to 'true' as of 1.8.1", rb_id2name(rb_frame_last_func()));
recur = Qfalse;
#else
recur = Qtrue;
#endif
}
else {
VALUE r;
Expand Down Expand Up @@ -613,11 +608,7 @@ rb_obj_singleton_methods(argc, argv, obj)

rb_scan_args(argc, argv, "01", &recur);
if (argc == 0) {
#if RUBY_VERSION_CODE < 181
rb_warn("singleton_methods: parameter will default to 'true' as of 1.8.1");
#else
recur = Qtrue;
#endif
}
klass = CLASS_OF(obj);
list = st_init_numtable();
Expand Down
1 change: 1 addition & 0 deletions error.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ name_err_initialize(argc, argv, self)
VALUE self;
{
VALUE name = (argc > 1) ? argv[--argc] : Qnil;

exc_initialize(argc, argv, self);
rb_iv_set(self, "name", name);
return self;
Expand Down
1 change: 0 additions & 1 deletion eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -4727,7 +4727,6 @@ rb_method_missing(argc, argv, obj)

id = SYM2ID(argv[0]);


switch (TYPE(obj)) {
case T_NIL:
desc = "nil";
Expand Down
2 changes: 1 addition & 1 deletion file.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ rb_file_path(obj)

fptr = RFILE(rb_io_taint_check(obj))->fptr;
if (!fptr->path) return Qnil;
return rb_str_new2(fptr->path);
return rb_tainted_str_new2(fptr->path);
}

static VALUE
Expand Down
10 changes: 0 additions & 10 deletions hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,12 +529,6 @@ rb_hash_select(argc, argv, hash)
{
VALUE result;

if (!rb_block_given_p()) {
#if RUBY_VERSION_CODE < 181
rb_warn("Hash#select(key..) is deprecated; use Hash#values_at");
#endif
return rb_hash_values_at(argc, argv, hash);
}
if (argc > 0) {
rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
}
Expand Down Expand Up @@ -1454,10 +1448,6 @@ env_select(argc, argv)
VALUE result;
char **env;

if (!rb_block_given_p()) {
rb_warn("ENV.select(index..) is deprecated; use ENV.values_at");
return env_values_at(argc, argv);
}
if (argc > 0) {
rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
}
Expand Down
2 changes: 2 additions & 0 deletions io.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@ read_all(fptr, siz, str)
n = rb_io_fread(RSTRING(str)->ptr+bytes, siz-bytes, fptr->f);
if (pos > 0 && n == 0 && bytes == 0) {
rb_str_resize(str,0);
if (!fptr->f) return Qnil;
if (feof(fptr->f)) return Qnil;
if (!ferror(fptr->f)) return str;
rb_sys_fail(fptr->path);
Expand Down Expand Up @@ -843,6 +844,7 @@ io_read(argc, argv, io)
n = rb_io_fread(RSTRING(str)->ptr, len, fptr->f);
if (n == 0) {
rb_str_resize(str,0);
if (!fptr->f) return Qnil;
if (feof(fptr->f)) return Qnil;
if (len > 0) rb_sys_fail(fptr->path);
}
Expand Down

0 comments on commit a4934a4

Please sign in to comment.