summaryrefslogtreecommitdiff
path: root/io.c
AgeCommit message (Collapse)Author
2003-11-06* io.c (rb_io_inspect): show the path also at a closed file.nobu
[ruby-dev:21851] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-04* io.c (read_all): fptr->f may be NULL, if IO is closed in thematz
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
2003-10-30* io.c (READ_DATA_BUFFERED): new macro to detect whether stdiomatz
buffer filled. * io.c (rb_io_fptr_cleanup): move path deallocation to rb_io_fptr_finalize (finalizer called by GC). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-05* eval.c (mark_frame_adj): need to adjust argv pointer if usingmatz
system's alloca. [ruby-core:01503] * io.c (rb_f_gets): should call next_argv() before type check current_file. [ruby-list:38336] * eval.c (proc_invoke): should retrieve retval when pcall is true. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-19* io.c (next_argv): should not call GetOpenFile() if rb_stdout isshugo
not a IO (T_FILE). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-04* eval.c (method_proc): should specify YIELD_FUNC_SVALUE.matz
[ruby-dev:21107] * marshal.c (w_object): should not call w_extended for USRMARSHAL dump. [ruby-dev:21106] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-02* numeric.c (flo_to_s): get rid of buffer overflow.matz
* io.c (appendline): clearerr(3) before raising exception, since exception may be captured by rescue. [ruby-talk:77794] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-01* io.c (rb_io_check_readable, rb_io_check_writable): ensure notnobu
closed at first. * io.c (rb_io_getline): check readable always. (ruby-bugs:PR#1069) * io.c (rb_io_each_byte): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-01* io.c (READ_DATA_PENDING_PTR): cast to get rid of warnings.nobu
* ext/socket/socket.c (unix_send_io, unix_recv_io): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-31* numeric.c (rb_num_coerce_relop): export function.matz
* marshal.c (w_object): check has been dropped. "_dump must return string." [ruby-dev:21024] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-29* marshal.c (w_object): if object responds to 'marshal_dump',matz
Marshal.dump uses it to dump object. unlike '_dump', marshal_dump returns any kind of object. * marshal.c (r_object0): restore instance by calling 'marshal_load' method. unlike '_load', it's an instance method, to handle cyclic reference. * marshal.c (marshal_load): all objects read from file should be tainted. [ruby-core:01325] * lib/timeout.rb (Timeout::timeout): execute immediately if sec is zero. * ext/socket/socket.c (socks_init): typo fixed. [ruby-talk:77232] * ext/socket/extconf.rb: the default value for --enable-socks is taken from ENV["SOCKS_SERVER"]. [ruby-talk:77232] * ruby.c (proc_options): add -W option. -W0 to shut up all warning messages. [ruby-talk:77227] * error.c (rb_warn): no message will be printed if the value of $VERBOSE is "nil", i.e. perfect silence. * ruby.c (verbose_setter): $VERBOSE value is either true, false, or nil. * io.c (Init_IO): no "read" check for $stdin. in addition some function names has been changed. * regex.c (re_match_exec): incorrect multibyte match. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-29* lib/net/smtp.rb (Net::SMTP::send0): add taint check.matz
* ruby.h (LLONG_MIN): wrong value. * io.c (rb_f_getc): $stdin may not be IO. [ruby-dev:20973] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-28* ext/stringio/stringio.c (strio_gets): only "gets" should set $_.matz
* ext/stringio/stringio.c (strio_getline): should not set $_ here. * io.c (argf_to_s): argf.to_s returns "ARGF". * io.c (set_defout_var, set_deferr_var): make $defout and $deferr obsolete. * io.c (set_input_var, set_output_var): allow $stdin, $stdout, $stderr not to be instance of IO. * io.c (rb_f_readline): forward method to current_file. gets, readline, readlines, getc, readchar, tell, seek, pos=, rewind, fileno, to_io, eof, each_line, each_byte, binmode, and closed? as well. * io.c (argf_forward): utility function to forward method to current_file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-26* io.c (io_reopen): avoid dup2() equal handles not to close itself andnobu
to get rid of a msvcrt bug. [ruby-dev:20919] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-26* io.c (rb_fdopen): set errno if it's zero on win32 platforms.usa
* ext/openssl/ossl_ssl.c (TO_SOCKET): define special version when _WIN32 is defined. this is ruby's problem, not OpenSSL. * win32/win32.c: remove some old comments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-24* gcc -Wall clean-up.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-26* io.c (io_fflush): need to check if closed after thread switch.nobu
[ruby-dev:20351] * io.c (fptr_finalize): ditto. * string.c (rb_str_rindex_m): fixed wrong fix. should move backward first only when matching from the end. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-23* io.c (io_close): missing prototype.aamine
* ext/socket/socket.c (bsock_do_not_rev_lookup_set): ditto. * ext/win32ole/win32ole.c (foletype_guid, foletype_progid): ditto. * error.c (syserr_initialize): length argument of sprintf() is an int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-23* dir.c (find_dirsep): get rid of warnings.nobu
* eval.c (error_print): temporary value might be disposed by GC. * hash.c (env_has_value, env_index): should not increment NULL. * io.c (io_read, rb_io_sysread): not read when length is 0. * io.c (rb_io_reopen): ensure initialized IO. * io.c (rb_io_init_copy): sychronize file pointer. * io.c (rb_io_s_pipe): make exception proof. * string.c (rb_str_rindex_m): Fixnum 0 matched end of string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-23* io.c (rb_open_file): initialize flags.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-23* string.c (rb_str_upto): generate sequence according to "succ"matz
order. formerly check was done by dictionary order. [ruby-talk:74138] * string.c (rb_string_value): fill constant empty string along with setting ELTS_SHARED if str->ptr is NULL. [ruby-core:01179] * string.c (rb_string_value_ptr): ditto. * string.c (rb_check_string_type): ditto. * string.c (str_gsub): move END(0) check before mbclen2(). * string.c (scan_once): reduce END(0) check. * io.c (rb_io_initialize): accept fixnum mode. * eval.c (error_print): replace strchr() by memchr(), einfo may contain "\0". * pack.c (pack_unpack): range check for "@" move; initialize check for "m". * error.c (syserr_initialize): avoid buffer overflow. * file.c (rb_file_s_readlink): expand buffer until readlink succeed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-07* parse.y (value_expr0): class and module statements should not bematz
warned for "void value expression". [ruby-talk:72989] * gc.c (add_final): should determine type by respond_to? * gc.c (define_final): ditto. * io.c (rb_io_ctl): should not depend on respond_to? * range.c (range_step): rb_check_string_type(). * process.c (proc_setgroups): new functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-06* eval.c (ruby_cleanup): $SAFE is turned off in the finalization.matz
Each END proc should preserve its own $SAFE level. [ruby-core:01119] * marshal.c (marshal_load): remove unused variable "hash". [ruby-core:01120] * hash.c (env_str_new): freeze strings from ENV. [ruby-talk:72860] * array.c (rb_ary_first): optional argument to retrieve first n elements. * array.c (rb_ary_last): optional argument to retrieve last n elements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-02* array.c (push_values_at): Array#values_at should work withmatz
ranges too. * range.c (rb_range_beg_len): length calculation was wrong. * eval.c (rb_call): should set T_ICLASS in the frame->last_class. [ruby-core:01110] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-30* io.c (rb_f_syscall): type dispatch should be based onmatz
rb_check_string_type(), not FIXNUM_P(), because values may be a bignum. [ruby-talk:72257] * eval.c (rb_call0): should pass the current klass value to block_invoke, which may be called via "super". [ruby-core:01077] * eval.c (block_invoke): now takes 4th argument "klass". * eval.c (block_alloc): should propagate BLOCK_PROC to ruby_block. * marshal.c (r_object0): should not use "yield" method, use "call" instead. (ruby-bugs-ja PR#476) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-21commit missnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-21* eval.c (rb_thread_fd_close): raise for writing threads.nobu
[ruby-dev:20269] * io.c (rb_io_close, io_reopen): ditto. * io.c (io_reopen): keep stdio objects for stdin, stdout, and stderr. [ruby-dev:19442] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-19* object.c (rb_mod_cmp): stupid comparison fixed.matz
* io.c (Init_IO): ARGF.path added (alias to ARGF.filename). [ruby-dev:20197] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-19* object.c (init_copy): rename copy_object as initialize_copy,matz
since it works as copy constructor. * eval.c (rb_add_method): initialize_copy should always be private, like initialize. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-15* io.c (set_stdio): better message.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-15* io.c (set_stdio): $stdin, $stdout, $stderr now became read-only.matz
* variable.c (readonly_setter): message changed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-13* eval.c (error_pos): use $deferr for output instead of stderrmatz
directly. * eval.c (error_print,error_handle,rb_longjmp,rb_thread_schedule): ditto. * io.c (Init_IO): new variable $deferr which is default output port of error messages. * io.c (rb_warn_m): new method "warn". [new] * error.c (warn_print): use $deferr. * error.c (rb_bug): ditto. * error.c (err_append): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-09* io.c (rb_io_reopen): It should be possible to reopen closed IO.matz
[ruby-talk:70941] * io.c (rb_io_reopen): inherit original file mode unless specified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-02* string.c (rb_str_ljust): now takes optional argument to specifymatz
pad string. [ruby-talk:70482] * string.c (rb_str_rjust): ditto. * string.c (rb_str_center): ditto. * string.c (rb_str_justify): utility function. * eval.c (rb_add_method): call singleton_method_added or method_added for every method definition (after ruby_running). [ruby-talk:70471] * array.c (rb_ary_reverse_bang): Array#reverse! should not return nil even for arrays sized less than 2. * io.c (argf_eof): should not block after reading all argument files. (ruby-bugs-ja PR#449) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-26* parse.y (open_args): warning message changed to "don't put spacematz
before argument parentheses". * io.c (argf_read): ARGF.read() should read all argument files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-25* io.c (argf_read): read should not span two files. [ruby-dev:20073]matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-25* eval.c (splat_value): split splat_value() and avalue_splat().matz
* io.c: there's no way to set non-IO value to current_file, thus no need for argf_forward(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-14* rubyio.h (struct OpenFile): add error raise flag to finalizer.matz
* io.c (Init_IO): define $/, $-0, and $\ as string-only variables. * string.c (rb_str_split_m): does not generate empty string if there's no match in the receiver. * io.c (fptr_finalize): should raise error on EBADF for readable IOs as well. * file.c (rb_stat): use rb_check_convert_type() to retrieve IO. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-10* io.c (set_stdin): assigned value must respond to "read" andnobu
"getc". * io.c (set_outfile): assigned value must respond to "write". (ruby-bugs-ja:PR#425) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-07* ext/socket/socket.c (sock_s_unpack_sockaddr_in): remove structmatz
size check. getnameinfo(3) can handle. [ruby-dev:19967] * io.c (io_read): do not call rb_sys_fail() when required data length is zero. (ruby-bugs-ja PR#420) * eval.c (umethod_proc): should raise TypeError, instead of returning error causing Proc. Following the principle of "fail early". [ruby-core:00927] * pack.c (pack_pack): small but serious typo. * eval.c (backtrace): skip internal allocator frame. (ruby-bugs-ja PR#416) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-03* eval.c (rb_f_missing): use "inspect" for T_OBJECT as well.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-25* io.c (rb_io_initialize): should check rb_secure(4).matz
* dir.c (dir_s_getwd): should check rb_secure(4). * object.c (rb_obj_infect): function version of OBJ_INFECT(). * eval.c (rb_secure_update): new function to check object update. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-23* io.c (rb_io_fread): may lose data on nonblocking read.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-20* eval.c (load_dyna): clear ruby_errinfo. (ruby-bugs-ja PR#409)matz
* io.c (read_all): make str empty if given. (ruby-bugs-ja PR#408) * io.c (io_read): ditto. * io.c (rb_io_sysread): ditto. * range.c: do not override min and max. * sprintf.c (remove_sign_bits): octal left most digit for negative numbers may be '3'. (ruby-bugs-ja PR#407) * sprintf.c (rb_f_sprintf): should prefix sign bits if bignum is negative, using sign_bits(). * eval.c (avalue_to_mrhs): split argument passing and assignment conversion. * eval.c (svalue_to_mrhs): ditto. * eval.c (avalue_to_svalue): avalue_to_svalue([[1,2]]) should be [[1,2]], not [1,2] to wrap-around. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-12* io.c (prep_stdio): set binmode only if the file descriptoreban
is not connected to a terminal on Cygwin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-04* io.c (rb_io_popen): do not call rb_io_close() directly, callmatz
"close" method instead. [ruby-dev:19717] * io.c (rb_io_s_open): ditto. * hash.c (rb_any_hash): remove DEFER_INTS. all do_hash() calls in st.c are at the top of functions. No reentrant problem. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-03* parse.y (arg): parse 'lhs = a rescue b' as 'lhs=(a rescue b)'.matz
* io.c (rb_io_fread): should not clearerr() if there's no filled buffer (i.e. rb_io_fread() returning zero). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-18* eval.c (rb_call0): should not report uninitialized warning bymatz
attribute reader method. * variable.c (rb_attr_get): new function to get instance variable without uninitialized warning. * io.c (argf_to_io): should prefetch argv. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-15* io.c (prep_stdio, Init_io): always set binmode on Cygwin.eban
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-09* io.c (rb_file_sysopen): rb_file_sysopen_internal() needs foureban
arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e