summaryrefslogtreecommitdiff
path: root/io.c
AgeCommit message (Collapse)Author
2002-08-29* io.c (read_all): should use off_t instead of long.eban
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-28* io.c (appendline): data was lost when raw mode.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-28adjust indetnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-28Int vs Long cleanup #3 (ruby-core:352)michal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-27* file.c (rb_find_file): $LOAD_PATH must not be empty.matz
* file.c (rb_find_file_ext): ditto. * range.c (range_eq): class check should be based on range.class, instead of Range to work with Range.dup. * range.c (range_eql): ditto. * class.c (rb_mod_dup): need to preserve metaclass and flags. * object.c (rb_cstr_to_dbl): had a buffer overrun. * marshal.c (w_class): integrate singleton check into a funciton to follow DRY principle. * marshal.c (w_uclass): should check singleton method. * object.c (rb_obj_dup): dmark and dfree functions must be match for T_DATA type. * object.c (rb_obj_dup): class of the duped object must be match to the class of the original. * re.c (rb_reg_quote): do not escape \t, \f, \r, \n, for they are not regular expression metacharacters. * time.c (time_s_alloc): use time_free instead of free (null check, also serves for type mark). * time.c (time_s_at): check dfree function too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-21*.c: Int vs Long cleanupmichal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-21* eval.c (rb_thread_cleanup): should not modify the globalmatz
variable curr_thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-20* replace of check EPIPE error(in getc()) rutine on bcc32.H_Konishi
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-20* io.c (rb_io_putc): output via rb_io_write().matz
* re.c (rb_reg_initialize_m): frozen check should be moved here from rb_reg_initialize(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-16* io.c (NOFILE): define NOFILE as 64 if not defined.eban
* signal.c (sighandler_t): rename to sh_t on dietlibc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-16* io.c (rb_io_fread): renamed from io_fread and made extern.nobu
* marshal.c (r_bytes0): check if successfully read, use rb_io_fread() instead of fread() to be preemptive. (ruby-bugs-ja:PR#294, 295) * rubyio.h (rb_io_fread): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-28* io.c (pipe_finalize, pipe_popen): two-way pipe support for win32.usa
* win32/win32.c (ChildRecord, FindFreeChildSlot): ditto. * win32/win32.c, win32/win32.h (pipe_exec): new function for two-way pipe support for win32. * win32/win32.c, win32/win32.h (FindPipedChildSlot, rb_w32_popen, rb_w32_pclose): removed functions for two-way pipe support for win32. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-11new platform [bccwin32] merged.H_Konishi
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-29* parse.y: yyparse #defines moved from intern.hmatz
* ruby.c (proc_options): access prefixed "ruby_yydebug". * applied modifies to pacify some of gcc -Wall warnings. * parse.y (arg): no more ugly hack for "**", so that "-2**2" to be parsed as "(-2)**2", whereas "- 2**2" or "-(2)**2" to be parsed as "-(2**2)". * parse.y (yylex): '-2' to be literal fixnum. [new] * time.c (time_succ): new method for Range support. * time.c (time_arg): nil test against v[6] (usec). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-23* ruby.c (proc_options): removed "-*-" support for #! line.matz
* io.c (rb_io_s_sysopen): new method to get a raw file descriptor. [new] * ext/socket/socket.c (tcp_sysaccept): new method to return an accepted socket fd (integer). [new] * ext/socket/socket.c (unix_sysaccept,sock_sysaccept): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-20* io.c (rb_io_clone): writing stream was not copied properly.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-02* error.c: use HAVE_DECL_SYS_NERR instead of platform names.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-24* io.c (rb_io_mode_flags): both 'r+b' and 'rb+' should be allowed.matz
* io.c (rb_io_mode_modenum): ditto. * gc.c (rb_memerror): rename from mem_error, and exported. * gc.c (Init_GC): pre-allocate NoMemoryError instance. * object.c (convert_type): error message changed from "failed to convert" to "cannot convert", since it does not try to convert if an object does not respond to the converting method. * eval.c (block_pass): convert Method to Proc using rb_check_convert_type(). * object.c (rb_check_convert_type): always convert T_DATA * eval.c (rb_thread_cleanup): should not terminate main_thread by Fatal error. * regex.c (is_in_list): need to not exclude NUL and NEWLINE. * re.c (rb_reg_expr_str): wrong backslash escapement. * re.c (rb_reg_expr_str): do not escape embedded space characters. * marshal.c (w_object): T_DATA process patch from Joel VanderWerf <vjoel@PATH.Berkeley.EDU>. This is temporary hack; it remains undocumented, and it will be removed when marshaling is re-designed. * marshal.c (r_object): ditto. * numeric.c (num_step): Integer#step is moved to Numeric#step; Fixnum#step is merged into this method. * numeric.c (int_dotimes): Fixnum#times is merged. * numeric.c (int_upto): Fixnum#upto is merged. * numeric.c (int_downto): Fixnum#downto is merged. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-18* re.c (rb_reg_expr_str): should treat backslash specially inmatz
escaping. * io.c: complete off_t handling; missing argument for fptr_finalize(); polished rb_scan_args call. * dir.c: wrap multi-statment macro by do { } while (0) * eval.c, numeric,c, sprintf.c, util.c: ditto. * bignum.c (rb_big_eq): check `y == x' if y is neither Fixnum, Bignum, nor Float. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-15* pack.c (pack_unpack): should treat 'U' in character unit, not inmatz
byte unit. * error.c (exc_initialize): should clear backtrace information. * io.c (rb_io_fptr_cleanup): should close IO created by IO.new(fd). * rubyio.h: remove FMODE_FDOPEN git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-12* struct.c (rb_struct_select): fix typo.matz
* io.c (io_write): check error if written data is less than specified size to detect EPIPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-11* io.c (remain_size): IO#read returns "" if file.size == 0.eban
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-02* Makefile.in (CPPFLAGS): remove @includedir@.matz
* lib/mkmf.rb (create_makefile): ditto. * ext/extmk.rb.in (create_makefile): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-01* io.c (rb_io_fptr_cleanup): need flush even when io will not bematz
closed. * io.c (rb_io_initialize): was calling wrong function rb_io_mode_flags(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-01* re.c (match_setter): it's OK to assign nil to $~.matz
* io.c (rb_io_fptr_cleanup): do not close IO created by for_fd(). * io.c (rb_io_initialize): mark IO created by for_fd * ext/socket/socket.c (bsock_s_for_fd): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-29* io.c (io_fflush): DRY patch from /Christoph applied.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-28* ext/socket/socket.c (sock_addrinfo): should specify socktypematz
from outside. * io.c (argf_binmode): should call next_argv() to initialize ARGF. * io.c (argf_filename): ditto. * io.c (argf_file): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-27* io.c (READ_DATA_PENDING): configure.in has supported for uClibc,eban
so remove uClibc stuff. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-27typonobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-27* io.c (rb_io_sysseek): new method based on a patch from Aristarkhmatz
A Zagorodnikov <xm@bolotov-team.ru>. [new] * io.c (READ_DATA_PENDING): use !feof(fp) for default behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-25* configure.in (FILE_READPTR): new. for IO#gets improvement.nobu
* io.c (READ_DATA_PENDING_PTR): ditto. * io.c (remain_size): separated from read_all(). * io.c (read_all): argument chagend. * io.c (appendline): new. get a line and append to string. * io.c (swallow): new. swallow continuous line delimiters. * io.c (rb_io_getline_fast): add delimiter argument. * io.c (rb_io_getline): performance improvement. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-25* ext/socket/socket.c (bsock_do_not_rev_lookup_set): should not bematz
allowed when $SAFE > 3. * eval.c (rb_thread_ready): THREAD_TO_KILL threads should not turn into THREAD_RUNNABLE on wakeup. * eval.c (rb_thread_list): THREAD_TO_KILL threads should be in the list. * eval.c (thgroup_list): ditto; by moving gid clearance from rb_thread_cleanup(). * dir.c (fnmatch): "*/bar" (with FNM_PATHNAME flag) does not match "foo/bar". * io.c (read_all): files on /proc filesystem with zero stat size, may have contents. * ext/socket/socket.c (tcp_s_gethostbyname): refactored. * ext/socket/socket.c (sock_s_gethostbyname): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-22* the VMS support patch submitted by Akiyoshi, Masamichimatz
<Masamichi.Akiyoshi@jp.compaq.com> is merged. * eval.c (exec_under): changing ruby_class is OK, but should not alter cbase. * eval.c (yield_under_i): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-14* re.c (rb_reg_match): should clear $~ if operand is nil.matz
* re.c (rb_reg_match2): ditto. * configure: merge Jonathan Baker's large file support patch [ruby-talk:35316], with read_all patch in [ruby-talk:35470]. * eval.c (rb_f_abort): optional message argument that be printed on termination. [new] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-27* io.c (READ_DATA_PENDING): uClibc support.eban
* random.c (rand_init): ditto. * ext/socket/{addinfo.h,getaddrinfo.c} (gai_strerror): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-22* bignum.c (get2comp): need to specify to carry or not.matz
* io.c (rb_io_inspect): embed path info. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-20* intern.h: prototypes; rb_io_addstr(), rb_io_printf(),nobu
rb_io_print(), rb_io_puts() * io.c (rb_io_addstr): make extern. * io.c (rb_io_printf): ditto. * io.c (rb_io_print): ditto. * io.c (rb_io_puts): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-20* io.c (rb_io_close): return Qnil.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-20* hash.c (rb_any_cmp): should handle Qundef in keys.matz
* eval.c (remove_method): should not remove a empty method to implement "undef". * eval.c (rb_eval): should allow singleton class def for true/false/nil. * parse.y (str_extend): backslash escape was done wrong. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-19* io.c (rb_io_ungetc): don't fail pushed EOF back.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-07* io.c (io_write): flag when buffered write is done.matz
* io.c (fptr_finalize): do not raise error on EBADF if write buffer is empty. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-06* io.c (rb_io_readlines): avoid calling GetOpenFile() repeatedly.matz
* io.c (rb_io_each_line): ditto. * io.c (argf_getline): ditto. * process.c: should include <time.h> to get proper CLK_TCK. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-05* io.c (fptr_finalize): ignore EBADF when f and f2 use samenobu
descriptor. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-05* io.c (fptr_finalize): should raise error when fclose fails.matz
* eval.c (method_inspect): proper output format to distinguish methods and singleton methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-23* array.c (Init_Array): remove Array#filter.matz
* object.c (rb_mod_initialize): should accept zero argument. * object.c (rb_mod_cmp): should raise ArgumentError if inheritance/inclusion relation between two classes/modules is not defined. [new] * io.c (rb_io_fsync): new method. [new] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-21* eval.c (ruby_stop): should not trace error handler.matz
* signal.c (install_sighandler): do not install sighandler unless the old value is SIG_DFL. * io.c (io_write): should not raise exception on O_NONBLOCK io. * dir.c (dir_set_pos): seek should return dir, pos= should not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-18* io.c (rb_io_s_new): block check moved from initialize to thismatz
method. * io.c (rb_io_s_open): open should call initialize too. IO#for_fd also calls initialize. [new] * error.c (rb_sys_fail): replace INT2FIX() by INT2NUM() since errno value may not fit in Fixnum size on Hurd. * error.c (set_syserr): ditto. * dir.c (dir_s_glob): returns nil if block given. * io.c (rb_io_each_byte): should return self. * io.c (rb_io_close_m): close check added. * dir.c (dir_seek): should return pos. * parse.y (fixpos): orig may be (NODE*)1, which should not be dereferenced. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-11* re.c (match_select): should propagate taintness.matz
* hash.c (rb_hash_set_default): Hash#default= should return the new value. * string.c (rb_str_to_i): accepts optional base argument. [new] * numeric.c (rb_fix2str): should not handle negative fixnum values int32 via calling sprintf() directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-04* process.c (rb_f_system): abandon vfork.matz
* io.c (pipe_open): ditto. * defines.h: sparc linux needs different FLUSH_REGISTER_WINDOWS * regex.c (re_search): abandon stclass optimization. * bignum.c (rb_cstr2inum): deny "0_". * bignum.c (rb_cstr2inum): allow "0\n" and so on. * error.c (rb_invalid_str): utility function to show inspect()'ed string. * bignum.c (rb_cstr2inum): prints invalid strings in inspect()'ed format. * object.c (rb_Float): ditto. * object.c (rb_convert_type): no longer use rb_rescue(). * re.c (rb_reg_search): initialize taint status of match object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-21* time.c (time_plus): result should not be negative unlessmatz
NEGATIVE_TIME_T is defined. * time.c (time_new_internal): should check tv_sec overflow too. * time.c (time_timeval): should check time_t range when time is initialized from float. * time.c (time_plus): uses modf(3). * variable.c (rb_cvar_set): add frozen class/module check. * variable.c (rb_cvar_declare): add frozen class/module check. * re.c (match_to_a): should propagate taint. * re.c (rb_reg_s_quote): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e