aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
Commit message (Collapse)AuthorAgeFilesLines
* * 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
* * io.c (read_buffered_data): extracted from rb_io_fread.akr2004-08-111-21/+136
| | | | | | | | (io_readpartial): new method IO#readpartial. [ruby-dev:24055] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * env.h: remove argv from ruby_frame.matz2004-07-281-1/+1
| | | | | | | | | | | | | | | | | | * eval.c (rb_eval): no more copy on write. * eval.c (assign): ditto. * eval.c (rb_call0): can receive *rest by specifying negative argc. (-1 means 0 arg and *rest, -2 means 1 arg and *rest...) * eval.c (rb_call0): properly set frame's argc counter. * gc.c (rb_gc_mark_frame): need not to mark frame's argv * gc.c (run_final): wrong order of data. [ruby-dev:23948] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_popen): update the document for the first argument andnobu2004-06-291-209/+217
| | | | | | | | | | exceptions. * process.c (rb_f_exec, rb_f_system): update the document for exceptions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_fopen, rb_fdopen, rb_io_reopen): setvbuf() may returnnobu2004-06-251-3/+3
| | | | | | | positive value on failure. [ruby-dev:23792] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (sock_sockaddr): Socket#gethostbyname()matz2004-06-241-7/+7
| | | | | | | | should give us packed address, not struct sockaddr. [ruby-core:03053] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_fread): return already read data when system call isnobu2004-06-241-3/+2
| | | | | | | interrupted. [ruby-talk:97206] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io_seek()'s retval should be checked [ruby-core:03045]michal2004-06-231-3/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_initialize): should check fcntl result. [ruby-dev:23742]nobu2004-06-221-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_gets_m): set lastline ($_) even when read line ismatz2004-06-041-3/+1
| | | | | | | nil. [ruby-dev:23663] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_fwrite): check all case errno != 0 [ruby-dev:23648]ocean2004-05-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_fwrite): should check if errnro == ENOENT, too.eban2004-05-271-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_fwrite): workaround for bcc32's fwrite bug.eban2004-05-271-2/+6
| | | | | | | add errno checking. [ruby-dev:23627] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_init_copy): copy also positions. [ruby-talk:100910]nobu2004-05-261-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_f_open): open should not ignore block when "to_open"matz2004-05-081-1/+5
| | | | | | | | | method is used. [ruby-dev:23478] * ext/dbm/dbm.c (fdbm_modify): typo fixed. [ruby-dev:23473] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (string_content): turn off NODE_NEWLINE flag to avoidmatz2004-05-071-0/+12
| | | | | | | | | | | | | | | | | | | | | | | unnecessary line trace for inlined expression. (ruby-bugs PR#1320) * numeric.c (flo_to_s): tweak output string based to preserve decimal point and to remove trailing zeros. [ruby-talk:97891] * string.c (rb_str_index_m): use unsigned comparison for T_FIXNUM search. [ruby-talk:97342] * hash.c (rb_hash_equal): returns true if two hashes have same set of key-value set. [ruby-talk:97559] * hash.c (rb_hash_eql): returns true if two hashes are equal and have same default values. * string.c (rb_str_equal): always returns true or false, never returns nil. [ruby-dev:23404] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c, io.c, pack.c, lib/benchmark.rb, lib/cgi.rb, lib/csv.rb,nobu2004-04-181-3/+3
| | | | | | | | | | | | | | lib/date.rb, lib/ftools.rb, lib/getoptlong.rb, lib/logger.rb, lib/matrix.rb, lib/monitor.rb, lib/set.rb, lib/thwait.rb, lib/timeout.rb, lib/yaml.rb, lib/drb/drb.rb, lib/irb/workspace.rb, lib/net/ftp.rb, lib/net/http.rb, lib/net/imap.rb, lib/net/pop.rb, lib/net/telnet.rb, lib/racc/parser.rb, lib/rinda/rinda.rb, lib/rinda/tuplespace.rb, lib/shell/command-processor.rb, lib/soap/rpc/soaplet.rb, lib/test/unit/testcase.rb, lib/test/unit/testsuite.rb: typo fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, enum.c, eval.c, file.c, io.c, numeric.c, object.c, prec.c,nobu2004-04-141-4/+4
| | | | | | | process.c, re.c, string.c: typos in RDoc comments. [ruby-core:02783] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_binmode): inverted condition. [ruby-dev:23349]nobu2004-04-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * pack.c (pack_pack): use NUM2INT() instead of num2i32().matz2004-04-071-6/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e