of a tainted value. Patch by unak.
* util.c, file.c: prevents a buffer over-run on windows.
Patch by unak.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@28522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
--
* io.c (io_cntl): update max file descriptor by the result of
fcntl(F_DUPFD).
--
* io.c (io_cntl): F_DUPFD is platform dependent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@26502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
--
Set encodings of stdio after setting default internal and external.
* io.c (rb_stdio_set_default_encoding): added.
* ruby.c (process_options): call rb_stdio_set_default_encoding
after setting defualt internal and external.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@24456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
--
* io.c (argf_eof): should not have reached EOF before trying to
read. based on a patch by Heesob Park <phasis AT gmail.com> at
[ruby-core:24559]. [ruby-core:24557]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@24449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
--
* io.c (pipe_open): handles leaked on win32 when an error occurs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@24120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
--
* io.c (argf_rewind): need to rewind $. and ARGF.lineno.
[ruby-core:24046]
* io.c (struct argf): refactoring on $. and ARGF.lineno behavior.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@24044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
--
* io.c (argf_binmode_m): should call rb_io_ascii8bit_binmode() to
set its encoding to ASCII-8BIT. [ruby-core:24029]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@24039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
--
* io.c (argf_skip): should close only when current_file is available.
--
* test/ruby/test_argf.rb (TestArgf#test_skip): updated test
according to clarified behavior.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@23790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
--
* io.c (copy_stream_fallback_body): off_t may be larger than long.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@23185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
--
* io.c (rb_io_getline_1): enables limit even if rs is given.
[ruby-core:22434]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@22740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (io_encoding_set): ignore second argument when external and
internal are same. [ruby-dev:37939]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@22523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (rb_io_close_read): call rb_io_fptr_cleanup() instead of
fptr_finalize() because the fptr has special finalizser if it is a
pipe. [ruby-dev:37757] (3)
* io.c (io_reopen, rb_io_init_copy): should register fptr to
pipe_list when copying pipe fptr.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (fptr_finalize): don't allocate objects if noraise.
(finish_writeconv): add noalloc argument to be able to avoid
object allocation.
(finish_writeconv_arg): introduced again.
(finish_writeconv_sync): follow the above change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (fptr_finalize): close the IO object even if finish_writeconv or
flush is failed.
(finish_writeconv): don't raise. return errno or exception.
(finish_writeconv_arg): removed.
(finish_writeconv_sync): follow finish_writeconv change.
* transcode.c (rb_econv_make_exception): new function.
* include/ruby/encoding.h (rb_econv_make_exception): declared.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (fptr_finalize): close the IO object even if close(2) is failed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (rb_io_flush): fsync() after buffer is flushed on win32.
[ruby-core:20043]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c: rdoc for File::open and 1.9 feature in file modes.
* transcode.c: rdoc for String#encode
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (pipe_open): need to initialize args.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/win32.c (rb_w32_read): ERROR_BROKEN_PIPE is not a real error
at this point.
* io.c (pipe_open): use rb_w32_spawn() instead of rb_w32_pipe_exec()
to use our own redirection scheme.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@20897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (rb_io_extract_encoding_option): "internal_encoding: nil"
to specify no-transcoding. and other corner case fixed.
[ruby-dev:37496]
* hash.c (rb_hash_lookup2): new function to look-up hash with
default value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@20886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (io_binwrite): arg.offset should be updated after retry.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@20552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (rb_io_rewind): should reset fptr->readconv if it's
available.
* io.c (more_char): clear readconv at EOF.
* test/ruby/test_file.rb: should not read after EOF. use rewind
instead.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@20058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (extract_binmode): new function to extract binmode/textmode
options from hash.
* io.c (rb_io_extract_modeenc): use above function.
* io.c (rb_io_s_pipe): recognize binmode/textmode options.
* io.c (make_readconv): now can specify the size of cbuf.
* io.c (read_all, appendline, io_getc, rb_io_ungetc): follow above
change.
* win32/win32.c (rb_w32_pipe_exec): internal fds should be always
binmode.
* test/ruby/test_file.rb (test_each_char_extended_file,
test_getbyte_extended_file): add tests.
* test/ruby/test_file.rb (test_*_extended_file): test in default/text/
binary mode.
* test/ruby/test_file.rb (test_para_gets_extended_file): output file
should be binmode.
* test/ruby/test_io.rb (test_copy_stream, test_copy_stream_socket): skip
some tests if there isn't IO#nonblock=.
* test/ruby/test_io.rb (test_close_on_exec): skip if there isn't
IO#close_on_exec=.
* test/ruby/test_io.rb (test_bytes, test_readbyte): depend on binmode.
* test/ruby/test_io.rb (test_sysopen): should specify the mode of
IO::for_fd if F_GETFL is not available.
* test/ruby/test_io_m17n.rb (test_getc_invalid3): should set binmode if
enc is not compatible with ASCII.
* test/ruby/test_require.rb (test_require_too_long_filename): too long
commandline may be rejected by OS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@19999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e