aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
Commit message (Collapse)AuthorAgeFilesLines
* * object.c (convert_type): [ruby-core:03845]matz2004-11-291-5/+5
| | | | | | | | | | | | | | | * eval.c (rb_funcall_rescue): new function. * object.c (rb_Array): avoid using rb_respond_to(). * object.c (rb_Integer): ditto. * eval.c (get_backtrace): no conversion for nil. * parse.y (reduce_nodes): empty body should return nil. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (fptr_finalize): must not use FILE after fclose().nobu2004-11-291-5/+12
| | | | | | | [ruby-dev:24985] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* don't use READ_DATA_PENDING in previous changeakr2004-11-281-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_check_writable): restrict io_seek byakr2004-11-281-3/+2
| | | | | | | | | READ_DATA_PENDING because io_seek(fptr, 0, SEEK_CUR) is meaningful only if read buffer is not empty. call io_seek regardless of NEED_IO_SEEK_BETWEEN_RW. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (rb_io_fwrite): set path to NULLakr2004-11-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c: avoid avoid data loss with nonblocking fd andakr2004-11-271-13/+40
| | | | | | | | | | | | stdio buffering in sync mode. [ruby-dev:24966] based on matz's patch [ruby-dev:24967] (io_fwrite): new primitive writing function which writes directly if sync mode. (rb_io_fwrite): wrapper for io_fwrite now. (io_write): call io_fwrite instead of rb_io_fwrite. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_fread): [ruby-dev:24964]matz2004-11-271-10/+25
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_initialize): [ruby-dev:24963]matz2004-11-261-17/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_initialize): [ruby-dev:24962]matz2004-11-261-10/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_initialize): should retrieve flags from copying filematz2004-11-261-5/+7
| | | | | | | | | | | | descriptor. [ruby-dev:24961] * eval.c (method_missing): raise TypeError for classes do not have allocators. [ruby-core:03752] * lib/erb.rb: [ruby-core:03786] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_read): move StringValue() check before GetOpenFile().matz2004-11-251-1/+1
| | | | | | | [ruby-dev:24959] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: AC_PREREQ(2.53) [ruby-core:03800]matz2004-11-251-2/+4
| | | | | | | * io.c (read_all): [ruby-dev:24955] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_read): [ruby-dev:24952]matz2004-11-231-58/+53
| | | | | | | * configure.in, io.c: cancel [ ruby-Patches-1074 ]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_read): [ruby-dev:24952]matz2004-11-231-6/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_getline): f.gets("") did not work. [ruby-core:03771]aamine2004-11-201-4/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (__fpending): commit miss.eban2004-11-201-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_reopen): work around problem with Cygwin fseekoeban2004-11-201-3/+4
| | | | | | | returning ESPIPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_gsub): internal buffer should not be listed bymatz2004-11-191-0/+3
| | | | | | | | | | | ObjectSpace.each_object() by String#gsub. [ruby-dev:24931] * lib/cgi/session.rb (CGI::Session::FileStore::initialize): raise exception if data corresponding to session specified from the client does not exist. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c, rubyio.h (rb_io_modenum_flags): exported.nobu2004-11-181-1/+1
| | | | | | | | * ext/stringio/stringio.c (strio_initialize): allow Fixnum as mode as well as IO.new does. [ruby-dev:24896] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (rb_glob2): do not allocate buffer from heap to avoidmatz2004-11-101-0/+5
| | | | | | | | | | | | | | | memory leaks. use string object for buffering instead. [ruby-dev:24738] * dir.c (join_path): ditto. * io.c (io_read): external input buffer may be modified even after rb_str_locktmp(). [ruby-dev:24735] * dir.c (fnmatch): p or s may be NULL. [ruby-dev:24749] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (pipe_open): need to set cmd if argc == 0 (win32).usa2004-11-021-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (pipe_open): IO.popen should take array as 1st argument formatz2004-11-021-27/+25
| | | | | | | | | a command line. [ruby-dev:24678] * io.c (rb_io_s_popen): do not expand argv array. [ruby-dev:24670] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (proc_invoke): nail down dyna_var node when Proc objectmatz2004-11-011-16/+12
| | | | | | | | | or continuation is created. [ruby-dev:24671] * io.c (rb_io_s_popen): do not expand argv array. [ruby-dev:24670] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (pipe_open): avoid conflict of variable name. [ruby-dev:24662]usa2004-11-011-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_f_open): create copy of popen specifier. [ruby-dev:24656]matz2004-10-311-63/+26
| | | | | | | | | | | | | | | | * string.c (rb_str_locktmp): lock string temporarily. * string.c (str_independent): add tmplock check. * io.c (io_write): lock output string temporarily. [ruby-dev:24649] * io.c (io_write): use rb_str_locktmp(). * io.c (read_all): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_check_initialized): new function to check uninitializednobu2004-10-291-2/+10
| | | | | | | | | object. [ruby-talk:118234] * file.c (rb_file_path), io.c (rb_io_closed): check if initialized. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_cleanup): ruby_finalize_1 may cause exception,matz2004-10-291-3/+3
| | | | | | | should be wrapped by PUSH_TAG/POP_TAG(). [ruby-dev:24627] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * node.h (NODE_TYPESHIFT): allow 4 more bits for line numbers.matz2004-10-271-20/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | [ruby-talk:117841] * ruby.h (FL_ABLE): nodes are not subject for flag operations. * io.c (ARGF_FORWARD): should have specified argv explicitly, since we no longer have frame->argv saved. [ruby-dev:24602] * string.c (RESIZE_CAPA): check string attribute before modifying capacity member of string structure. [ruby-dev:24594] * ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain performance. [ruby-talk:117701] * sprintf.c (rb_f_sprintf): raise ArgumentError for extra arguments, unless (digit)$ style used. * io.c (rb_io_fptr_finalize): leave stdin/stdout/stderr open in interpreter termination. [ruby-dev:24579] * eval.c (frame_free): Guy Decoux solved the leak problem. Thanks. [ruby-core:03549] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c (zstream_shift_buffer): should restore classmatz2004-10-211-0/+2
| | | | | | | | | | | | | field of a buffer. [ruby-dev:24562] * eval.c (rb_alias): should warn on method discarding. [ruby-dev:24546] * ext/zlib/zlib.c (zstream_expand_buffer_into): hide internal string buffer by clearing klass. [ruby-dev:24548] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (pipe_open): variable name "fpw" is conflicted.eban2004-10-211-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (lex_getline): should not touch ruby_debug_lines ifmatz2004-10-201-0/+3
| | | | | | | | | RIPPER is defined. [ruby-dev:24547] * string.c (str_gsub): reentrant check. [ruby-dev:24432] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_getline): rs modification check should not interfere in the loop.nobu2004-10-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (read_all): block string buffer modification duringmatz2004-10-191-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rb_io_fread() by freezing it temporarily. [ruby-dev:24479] * dir.c (rb_push_glob): block call at once the end of method. [ruby-dev:24487] * ext/enumerator/enumerator.c (enum_each_slice): remove rb_gc_force_recycle() to prevent potential SEGV. [ruby-dev:24499] * ext/zlib/zlib.c (zstream_expand_buffer): hide internal string buffer by clearing klass. [ruby-dev:24510] * ext/socket/socket.c (sock_s_getservbyaname): protocol string might be altered. [ruby-dev:24503] * string.c (rb_str_upto): check if return value from succ is a string. [ruby-dev:24504] * io.c (rb_io_popen): get mode string via rb_io_flags_mode() to avoid mode string modification. [ruby-dev:24454] * io.c (rb_io_getline_fast): should take delim as unsigned char to distinguish EOF and '\377'. [ruby-dev:24460] * io.c (rb_io_getline): add check for RS modification. [ruby-dev:24461] * enum.c (enum_sort_by): use qsort() directly instead using rb_iterate(). [ruby-dev:24462] * enum.c (enum_each_with_index): remove rb_gc_force_recycle() to prevent access to recycled object (via continuation for example). [ruby-dev:24463] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_flags_mode, rb_io_mode_flags): distinguish whether filenobu2004-10-181-2/+5
| | | | | | | not existing is created. [ruby-dev:24505] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (MODE_BINMODE, MODE_BINARY): fixed reversed condition.eban2004-10-121-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_getline): should not treat char as negative value.nobu2004-10-091-1/+1
| | | | | | | [ruby-dev:24460] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_read): should freeze buffer before thread contextmatz2004-10-071-1/+1
| | | | | | | switch. [ruby-dev:24442] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * pack.c (pack_unpack): string conversion should at the top of thematz2004-10-071-1/+1
| | | | | | | | | | method. [ruby-dev:24439] * io.c (io_read): buffer should be frozen only after the length check. [ruby-dev:24440] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_s_sysopen): preserve path in the buffer allocated bymatz2004-10-061-6/+8
| | | | | | | ALLOCA_N() to prevent modification. [ruby-dev:24438] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_modenum_mode): typo fix again.eban2004-10-061-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_mode_flags): preserve append mode flag.matz2004-10-061-36/+36
| | | | | | | | | | | | | | | | | [ruby-dev:24436] * io.c (rb_io_modenum_mode): do not use external output buffer. * string.c (rb_str_justify): differ pointer retrieval to prevent padding string modification. [ruby-dev:24434] * range.c (range_each_func): allow func to terminate loop by returning RANGE_EACH_BREAK. * range.c (member_i): use RANGE_EACH_BREAK. [ruby-talk:114959] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_flags_mode): typo fix.eban2004-10-051-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_fopen): mode string copy at the lowest level.matz2004-10-051-38/+23
| | | | | | | | | | | | | | | | | | | | | | | * io.c (rb_io_flags_mode): requires output buffer no more. no allocation needed. * array.c (rb_ary_index): takes a block to compare items in an array. [ruby-talk:113069] [Ruby2] * array.c (rb_ary_rindex): ditto. * marshal.c (r_byte): retrieve pointer from string value for each time. [ruby-dev:24404] * marshal.c (r_bytes0): ditto. * enum.c (sort_by_i): re-entrance check added. [ruby-dev:24399] * io.c (io_read): should freeze all reading buffer. [ruby-dev:24400] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_file_open_internal, rb_io_reopen): fname might be alterednobu2004-10-041-9/+12
| | | | | | | while GC. [ruby-dev:24408] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_sum): string may be altered. [ruby-dev:24381]matz2004-10-011-1/+5
| | | | | | | | | | | | | | | | | | | | | | | * eval.c (rb_f_eval): defer pointer retrieval to prevent unsafe sourcefile string modification. [ruby-dev:24373] * io.c (io_read): block string buffer modification during rb_io_fread() by freezing it temporarily. [ruby-dev:24366] * io.c (rb_io_s_popen): mode argument may be altered. [ruby-dev:24375] * file.c (rb_file_s_basename): ext argument may be altered. [ruby-dev:24377] * enum.c (enum_sort_by): use NODE instead of 2 element arrays. [ruby-dev:24378] * string.c (rb_str_chomp_bang): StringValue() may change the receiver. [ruby-dev:24371] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c (gzfile_read_raw): call readpartial at first.akr2004-09-191-3/+3
| | | | | | | (Zlib::GzipReader#readpartial): new method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (rb_big_and): protect parameters from GC.matz2004-08-281-3/+0
| | | | | | | | | | | | [ruby-talk:110664] * error.c (exc_equal): exceptions are equal if they share same class, message and backtrace. [ruby-talk:110354] * error.c (name_err_mesg_equal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_check_writable): no need to check read buffer ifusa2004-08-201-1/+1
| | | | | | | already changed to write mode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (free_dir): fix memory leak. reported by yamamotomatz2004-08-191-7/+6
| | | | | | | | | | | | | | madoka. * eval.c (bind_eval): new method. [RCR 251] * string.c (rb_str_clear): new method. [ruby-dev:24104] * io.c (rb_io_reopen): should clear allocated OpenFile. pointed out by Guy Decoux. [ruby-core:03288] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_reopen): should clear allocated OpenFile. pointedmatz2004-08-171-1/+1
| | | | | | | out by Guy Decoux. [ruby-core:03288] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e