aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
Commit message (Collapse)AuthorAgeFilesLines
* * variable.c (rb_cvar_set): class variables become private to thematz2004-03-191-1/+0
| | | | | | | | | | | particular class/module. [Ruby2] * variable.c (rb_cvar_get): ditto. * io.c (rb_io_sync): need not to check writable. [ruby-core:02674] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_yield_0): should not re-submit TAG_BREAK if thismatz2004-03-151-2/+2
| | | | | | | yield is not break destination. [ruby-dev:23197] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * struct.c (rb_struct_s_def): Struct::new executes block withmatz2004-03-101-2/+3
| | | | | | | | | | generated struct class. [ruby-talk:02606] * io.c (rb_io_ungetc): raise IOError instead of calling rb_sys_fail(). [ruby-talk:23181] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (pipe_open): erred program name should be reported bynobu2004-03-021-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | exceptions, instead of the first argument. * process.c (rb_spawn): ditto. * process.c (proc_spawn_v): use first argument as program name. * win32/win32.c (rb_w32_aspawn): ditto. * win32/win32.c (CreateChild): search executable file if no program name given. * lib/drb/extservm.rb (invoke_service_command): use Process.spawn. [ruby-dev:23103] * lib/rdoc/ri/ri_display.rb (setup_pager): use IO.popen. [ruby-dev:23086], [ruby-dev:23103] * lib/rdoc/diagram.rb (convert_to_png): ditto. * lib/rdoc/generators/chm_generator.rb (compile_project): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (obj_free), io.c (rb_io_fptr_finalize), rubyio.h (OpenFile):nobu2004-02-251-11/+56
| | | | | | | | | sharing OpenFile. * io.c (rb_io_initialize): accept IO instance. [ruby-dev:22195] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (pipe_open): fix typo.nobu2004-02-201-1/+1
| | | | | | | | * win32/win32.c (CreateChild): first argument to CreateProcess() must have path, not just basename. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: check functions, fork spawnv.nobu2004-02-161-126/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | * io.c (rb_io_s_popen): accept argv not only single command line. * process.c (rb_proc_exec_n): export. * process.c (rb_check_argv): check if arguments are safe to invoke. * process.c (rb_fork): retry to fork. * process.c (rb_spawn): spawn child process asynchronously. * process.c (rb_f_system): raise an exception if the command could not execute. * win32/win32.c (rb_w32_argv_size): count necessary size for joined arguments. * win32/win32.c (rb_w32_join_argv): join arguments with quoting. * win32/win32.c (rb_w32_pipe_exec, rb_w32_spawn, rb_w32_aspawn): accept program name adding to command line. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove references to defoutdave2004-01-261-6/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c, error.c, file.c, io.c, numeric.c, object.c, re.c, struct.c,nobu2004-01-181-0/+1
| | | | | | | time.c: marked init_copy functions nodoc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_read): do not append EOF. (ruby-bugs-ja:PR#585)nobu2004-01-151-2/+5
| | | | | | | | * io.c (rb_io_fwrite): ad-hockery hack to get rid of HP-UX stdio weird behavior. [ruby-dev:22424] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (fptr_finalize): should save errno just after failure.nobu2004-01-061-7/+8
| | | | | | | [ruby-dev:22492] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c: merge tuning from H.Yamamoto <ocean@m2.ccsnet.ne.jp>.matz2004-01-021-5/+4
| | | | | | | | | | | | [ruby-dev:22476] * io.c (argf_eof): ARGF.eof? should not have any side effect. [ruby-dev:22469] * io.c (argf_each_byte): should return self. [ruby-dev:22465] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_f_readline): should raise EOFError at the end ofmatz2003-12-301-16/+16
| | | | | | | | | | | | | | | files. [ruby-dev:22458] * io.c (argf_read): should concatenate input files when length argument is nil. [ruby-dev:22450] * io.c (argf_read): should update supplied string buffer (2nd argument) even when IO#read is called multiple times. * io.c: should initialize lineno by zero. [ruby-dev:22460] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add RDoc for kernel functions, and tidy updave2003-12-301-0/+278
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Added RDoc for class IOdave2003-12-271-2/+819
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (next_argv): warn always for stdin on inplace edit mode.matz2003-12-261-10/+26
| | | | | | | | | * io.c (read_all): need to check string value. * io.c (argf_read): allow ARGF.read(nil). [ruby-dev:22433] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_f_backquote): need not to check nil result.matz2003-12-261-2/+1
| | | | | | | | | | | | | | | [ruby-core:02078] * io.c (rb_io_getline): should return nil on eof, even when nil rs is specified. [ruby-core:02077] * pack.c (pack_pack): add sign check for 'i', and 'l'. [ruby-dev:22427] * bignum.c (rb_quad_pack): add range check for 'quad int'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * MANIFEST: add vms/config.h and remove vms/config.h_in.usa2003-12-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [VMS] "rfm=stmlf" is specified for open() and fopen().akiyoshi2003-12-261-5/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (catch_timer): do not call rb_thread_schedule() inside tomatz2003-12-241-3/+3
| | | | | | | | | | | | | | | | | | | avoid pthread_mutex_lock() deadlock. interrupts to system calls are detected by TRAP_END via EINTR error. * eval.c (thread_timer): do not post signal unless it is absolutely necessary. * rubysig.h (TRAP_END): add CHECK_INTS to switch thread. * regex.c (re_compile_pattern): check if nextp is smaller than pend. [ruby-dev:22372] * eval.c (umethod_bind): remove method overridden check. [ruby-dev:22366] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Forgot to save buffer.... sighdave2003-12-241-0/+64
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (read_all): do not return nil at the end of file.matz2003-12-231-22/+21
| | | | | | | | | | | | | | | | | | | | | | | [ruby-dev:22334] * io.c (argf_read): do not depend on nil at eof behavior of IO#read(). * eval.c (rb_thread_join): dup exception before re-raising it. * io.c (rb_io_eof): call clearerr() to prevent side effect. this patch is supplied by Masahiro Sakai <sakai@tom.sfc.keio.ac.jp>. [ruby-dev:22234] * pack.c (OFF16): get offset for big endian machines. * pack.c (pack_pack): use OFF16 instead of OFF16B. [ruby-dev:22344] * pack.c (pack_unpack): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_ungetc): raise an exception at unread stream tonobu2003-12-231-2/+3
| | | | | | | | | | avoid unspecified behavior. [ruby-dev:22330] * test/ruby/test_system.rb (test_syntax): glob relatively from __FILE__. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * pack.c (pack_pack): remove unnecessary negative value check.matz2003-12-231-0/+1
| | | | | | | | | | [ruby-dev:22329] * io.c (rb_io_ungetc): need fflush before ungetc if write buffer is filled. [ruby-dev:22330] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (read_all): should return given string even if data read ismatz2003-12-101-2/+1
| | | | | | | empty. [ruby-dev:22207] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (rb_io_check_writable): don't call io_seek if EOF flag is set,akr2003-12-091-1/+1
| | | | | | | to avoid clearing EOF flag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_check_readable): Don't clear EOF flag by io_seek.akr2003-12-091-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (flush_before_seek): flush before seek on any platform.eban2003-12-061-4/+0
| | | | | | | * configure.in: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c (aix_loaderror): should not use member named 'errno' whichmatz2003-12-041-8/+6
| | | | | | | | | | | | | might be a macro (e.g. on AIX). * io.c (read_all): do not depend on lseek position. [ruby-dev:22026] * eval.c (rb_eval): preserve $! value when retry happens in the rescue clause. [ruby-talk:86697] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_read): should not terminate on empty string; waitmatz2003-12-031-6/+14
| | | | | | | | | | until real EOF. [ruby-dev:21969] * io.c (argf_read): should adjust length to read, when length is specified and read spans command line argument files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (appendline): file may not end with newline. a bug ifmatz2003-11-111-3/+11
| | | | | | | READ_DATA_PENDING_PTR is defined. [ruby-talk:84925] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_inspect): show the path also at a closed file.nobu2003-11-061-4/+10
| | | | | | | [ruby-dev:21851] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (read_all): fptr->f may be NULL, if IO is closed in thematz2003-11-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* * io.c (READ_DATA_BUFFERED): new macro to detect whether stdiomatz2003-10-301-7/+9
| | | | | | | | | | 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
* * eval.c (mark_frame_adj): need to adjust argv pointer if usingmatz2003-09-051-1/+1
| | | | | | | | | | | | 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
* * io.c (next_argv): should not call GetOpenFile() if rb_stdout isshugo2003-08-191-3/+5
| | | | | | | not a IO (T_FILE). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (method_proc): should specify YIELD_FUNC_SVALUE.matz2003-08-041-4/+4
| | | | | | | | | | [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
* * numeric.c (flo_to_s): get rid of buffer overflow.matz2003-08-021-1/+1
| | | | | | | | * 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
* * io.c (rb_io_check_readable, rb_io_check_writable): ensure notnobu2003-08-011-6/+5
| | | | | | | | | | | 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
* * io.c (READ_DATA_PENDING_PTR): cast to get rid of warnings.nobu2003-08-011-1/+1
| | | | | | | * 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
* * numeric.c (rb_num_coerce_relop): export function.matz2003-07-311-1/+2
| | | | | | | | * 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
* * marshal.c (w_object): if object responds to 'marshal_dump',matz2003-07-291-23/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* * lib/net/smtp.rb (Net::SMTP::send0): add taint check.matz2003-07-291-2/+5
| | | | | | | | | * 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
* * ext/stringio/stringio.c (strio_gets): only "gets" should set $_.matz2003-07-281-70/+152
| | | | | | | | | | | | | | | | | | | | | | | * 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
* * io.c (io_reopen): avoid dup2() equal handles not to close itself andnobu2003-07-261-24/+29
| | | | | | | 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
* * io.c (rb_fdopen): set errno if it's zero on win32 platforms.usa2003-07-261-0/+3
| | | | | | | | | | * 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
* * gcc -Wall clean-up.matz2003-07-241-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_fflush): need to check if closed after thread switch.nobu2003-06-261-1/+5
| | | | | | | | | | | | [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
* * io.c (io_close): missing prototype.aamine2003-06-231-0/+1
| | | | | | | | | * 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
* * dir.c (find_dirsep): get rid of warnings.nobu2003-06-231-6/+39
| | | | | | | | | | | | | | | | | | | * 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