Commit graph

984 commits

Author SHA1 Message Date
yugui
849e45dee8 merges r30536 from trunk into ruby_1_9_2.
--
* io.c (argf_next_argv): go advance when the next file cannot be
  read.  [ruby-core:34446]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-16 12:35:27 +00:00
yugui
161fde4a43 merges r30525 from trunk into ruby_1_9_2.
--
	* io.c (rb_f_syscall): Add 64bit Linux support. Some syscall takes
	  long type arguments.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-16 12:35:22 +00:00
yugui
54d8811ce6 merges r30526 and r30527 from trunk into ruby_1_9_2.
--
	* io.c (rb_f_syscall): Some syscall return unsigned or pointer value.
	  Therefore we should only check the result is -1 or not. [ruby-core:34062]
--
	* io.c (rb_f_syscall): Add warning messages. [ruby-core:34062]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-16 12:35:15 +00:00
yugui
829779e20c merges r30499 from trunk into ruby_1_9_2.
--
* io.c (Kernel.#syscall): implemented on LP64/LLP64 environments too.
  also uses __syscall if available for *BSD on 64bit architecture.
  [ruby-core:34062]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-16 12:35:08 +00:00
yugui
3143c6d381 merges r30349 from trunk into ruby_1_9_2.
--
* io.c (rb_io_extract_encoding_option): accept Encoding object as
  encoding: optional argument.  [ruby-dev:42884]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-16 06:30:14 +00:00
yugui
859ed45350 * io.c (io_fillbuf): fixes a mistake on merging r30280, at r30321.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-23 13:31:37 +00:00
yugui
a4610baeee merges r30280 from trunk into ruby_1_9_2.
--
	* io.c : add an extra byte to buffer for the specification of read
	  in Windows. see [ruby-core:33460] and r29980. and, we have to
	  discuss how to do this one byte.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-23 12:45:47 +00:00
yugui
243faf286f merges r30122 from trunk into ruby_1_9_2.
--
	* io.c (io_read): duplicate string if shared. [ruby-dev:42719]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-23 12:45:26 +00:00
yugui
b62f04f5e1 merges r29743 from trunk into ruby_1_9_2.
--
* io.c (pipe_finalize): status is success if no process.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-08 08:09:24 +00:00
yugui
d589c29331 merges r29454 from trunk into ruby_1_9_2.
--
* io.c (rb_io_ungetc): always see Bignum. On 32bit valid value
  may be a Bignum. On 64bit for errors. [ruby-dev:42366]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-02 08:07:04 +00:00
yugui
230b8b524d merges r29446 and r29448 from trunk into ruby_1_9_2.
--
* numeric.c (rb_enc_uint_chr): split from int_chr.

* numeric.c (int_chr): use rb_enc_uint_chr.

* include/ruby/encoding.h (rb_enc_uint_chr): added.
--
* io.c (rb_io_ungetc): use unsigned int for GB18030.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-02 08:06:46 +00:00
yugui
9b6125398f merges r29435 from trunk into ruby_1_9_2.
--
* io.c (rb_io_set_encoding): use rb_funcall2 when the io is not
  a T_FILE. [ruby-dev:42356]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-02 08:06:23 +00:00
yugui
14dfd98ee4 merges r29256 from trunk into ruby_1_9_2.
--
* io.c (rb_io_puts): fix for wide char encoding strings.
  [ruby-dev:42212]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@29909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-24 09:37:02 +00:00
yugui
03144f6df0 merges r29415 from trunk into ruby_1_9_2. fixes #3910 #3951 and #3959.
--
* io.c (fptr_finalize): write_mutex might have been destroyed
  already in finalization phase, as the order of finalizers is not
  guaranteed.  rb_mutex_t should be used in place of Mutex object
  in the future.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@29564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-23 09:36:52 +00:00
yugui
0956a6f4da merges r28687 from trunk into ruby_1_9_2.
--
* io.c (io_flush_buffer): write and buffer operations should be
  monolithic.  [ruby-core:31348]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-24 10:38:33 +00:00
yugui
aa1fdb9053 merges r28537 and r28555 from trunk into ruby_1_9_2.
--
* io.c (swallow, prepare_getline_args, rb_io_getline_1): fix for
  paragraph mode reading in non-ascii-compatible encoding.
  [ruby-dev:41803]
--
* test/ruby/test_io_m17n.rb (test_textmode_paragraph_nonasciicompat): should
  match the modes of both end of pipe as text mode.

* test/ruby/test_io_m17n.rb (test_binmode_paragraph_nonasciicompat): new test
  for binmode.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-10 04:05:59 +00:00
yugui
ec4ca0fcbb * io.c (argf_inplace_mode_set): prohibits an assignment
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_2@28522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-02 10:14:05 +00:00
nobu
1f1937111d * include/ruby/io.h, io.c: reverted r21709.
* ruby.c (load_file_internal): nothing to read if EOF reached
  while reading shebang.  [ruby-core:30910]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-27 14:31:19 +00:00
akr
c69fda5e2a * io.c (simple_sendfile): don't try to send data more than SSIZE_MAX
with single sendfile call..
  based on the patch by Eric Wong.  [ruby-core:30908]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-27 04:30:31 +00:00
marcandre
57502a5e57 merge from trunk (28381)
* io.c: rdoc fix for ARGF.lineno; see [ruby-core:29048]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-22 06:06:34 +00:00
naruse
05f0e2aed7 merge revision(s) 28243:
* io.c (rb_io_putc): documentation updated to mention putc would
	  not work well with multi-byte characters.  [ruby-core:30697]

	* io.c (rb_f_putc): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-10 01:06:37 +00:00
nobu
6fa0b50416 * io.c (parse_mode_enc): set set_by_bom bit. [ruby-core:30641]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-07 21:04:56 +00:00
tarui
a8ced88a3e * io.c (pipe_open): add RB_GC_GUARD.
This caused failure when test/ruby/test_argf.rb is executed with
	  GC.stress = true in mswin32_90


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-31 16:16:39 +00:00
nobu
950a917600 * removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29 18:51:39 +00:00
marcandre
26134a6dc1 * array.c: Documentation: change => in call-seq to ->.
Harmonize "#=>" in examples. [ruby-core:30206]

* bignum.c: ditto

* class.c: ditto

* compar.c: ditto

* cont.c: ditto

* dir.c: ditto

* encoding.c: ditto

* enum.c: ditto

* enumerator.c: ditto

* error.c: ditto

* eval.c: ditto

* file.c: ditto

* gc.c: ditto

* hash.c: ditto

* io.c: ditto

* load.c: ditto

* marshal.c: ditto

* math.c: ditto

* numeric.c: ditto

* object.c: ditto

* pack.c: ditto

* proc.c: ditto

* process.c: ditto

* random.c: ditto

* range.c: ditto

* re.c: ditto

* ruby.c: ditto

* signal.c: ditto

* sprintf.c: ditto

* string.c: ditto

* struct.c: ditto

* thread.c: ditto

* time.c: ditto

* transcode.c: ditto

* variable.c: ditto

* vm_eval.c: ditto

* vm_method.c: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@27870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17 21:50:00 +00:00
usa
8bc7d22fb1 merge from trunk (r27782)
* io.c (swallow): should use more_char() instead of fill_cbuf().
  suggested by akr.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@27783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-13 09:20:42 +00:00
marcandre
d6b1887dd3 * array.c: Harmonize documentation, in particular regarding:
- methods returning enumerators
    - array methods and argument naming (array -> ary, an_array -> new_ary)
    - minor improvements, typo fixed and styling issues

  Other documentation errors fixed:
    - return value was self instead of a new array (or vice-versa) for
      Array#{pop,shift,permutation,repeated_permutation,keep_if}
    - Array#rindex was missing the form with a block.

* dir.c: ditto.

* enum.c: ditto. Modified Enumerable#reverse_each' documentation to clarify
  that #each will be finish before any element is yielded.

* error.c: ditto.

* gc.c: ditto.

* hash.c: ditto.

* io.c: ditto. IO#{codepoints,each_codepoint} fixed as per [ruby-core:23948]

* numeric.c: ditto.

* range.c: ditto.

* string.c: ditto.

* struct.c: ditto.

* vm_eval.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@27778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-13 05:52:16 +00:00
usa
fab261586a merge from trunk (r27768-r27770)
* io.c (swallow): support text mode and UTF-16/32 as internal encoding.
  [Bug #1576]

* io.c (io_shift_cbuf): read and throw it away when str is NULL.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@27771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-13 04:05:19 +00:00
usa
52583c34d1 merge from trunk (r27718)
* win32/win32.c, include/ruby/win32.h (rb_w32_has_cancel_io): new
  function.

* io.c (WAIT_FD_IN_WIN32): check only when it's not cancelable.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@27732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-11 05:09:59 +00:00
shyouhei
93121d99c9 * io.c (nogvl_copy_stream_sendfile): mixed decls not allowed.
* include/ruby/ruby.h (rb_intern): C90 needs nonempty macro
	  arguments.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@27684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-08 17:41:49 +00:00
marcandre
fecc53f0ec * error.c: RDoc for subclasses of Exception. [ruby-core:28394]
* cont.c: ditto

* enumerator.c: ditto

* io.c: ditto

* math.c: ditto

* numeric.c: ditto

* proc.c: ditto

* re.c: ditto

* thread.c: ditto

* transcode.c: ditto. Thanks to Run Paint for some of the documentation.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@27673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-08 04:58:32 +00:00
naruse
e6ccffd966 Add rdoc about IO#read(length). [ruby-core:29161]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-03 22:17:49 +00:00
usa
6c28f99d88 * merge some patches from win32-uncode-test branch.
see #1685.

* file.c, include/ruby/intern.h (rb_str_encode_ospath): new function
  to convert encoding for pathname.

* win32.c, include/ruby/win32.h (rb_w32_ulink, rb_w32_urename,
  rb_w32_ustati64, rb_w32_uopen, rb_w32_uutime, rb_w32_uchdir,
  rb_w32_umkdir, rb_w32_urmdir, rb_w32_uunlink): new functions to
  accept UTF-8 path.

* win32/win32.c (rb_w32_opendir, link, rb_w32_stati64, rb_w32_utime,
  rb_w32_unlink): use WCHAR path internally.

* file.c (rb_stat, eaccess, access_internal, rb_file_s_ftype,
  chmod_internal, rb_file_chmod, rb_file_chown, utime_internal,
  rb_file_s_link, unlink_internal, rb_file_s_rename): use UTF-8 version
  functions on Win32.

* file.c (apply2files, rb_stat, rb_file_s_lstat, rb_file_symlink_p,
  rb_file_readable_p, rb_file_writable_p, rb_file_executable_p,
  check3rdbyte, rb_file_identical_p, rb_file_chmod, rb_file_chown,
  rb_file_s_link, rb_file_s_symlink, rb_file_s_rename): call
  rb_str_encode_ospath() before passing the path to system.

* io.c (rb_sysopen): ditto.

* dir.c (dir_chdir, dir_s_mkdir, dir_s_rmdir): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-30 17:56:23 +00:00
nobu
bfeeb913fe * io.c (seek_before_access): fixed argument type.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-30 17:22:32 +00:00
nobu
55181301ae * io.c (seek_before_access): renamed. see [ruby-core:29861].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-29 02:20:58 +00:00
nobu
e1c34852dc * io.c (rb_io_s_binread): fixed rdoc. parts of a patch from Roger
Pack in [ruby-core:29861].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-29 02:17:12 +00:00
akr
87ba383aa3 * io.c (select_internal): IO which cbuf is not empty is readable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-26 21:21:07 +00:00
nobu
8ebadc63f4 * io.c (ruby_dup): update max fd.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-25 14:50:10 +00:00
akr
ba2ee2f04c update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-24 12:00:56 +00:00
akr
02efdb4845 update document.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-24 06:05:34 +00:00
akr
78db46b31c * io.c: raise IOError when byte oriented operations occur with
non-empty character buffer.
  [ruby-dev:40493] [ruby-dev:40506]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-24 05:42:50 +00:00
naruse
4131d6176a * io.c (io_getc): fix incomplete character immediately before EOF
with newline converter. [ruby-dev:41024]
  run test only when "Create Shortcut (&S)" menu is found.
* lib/rexml/parsers/xpathparser.rb (PathExpr): ditto.
* lib/matrix.rb (Vector#each): make Vector enumerable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-21 06:37:18 +00:00
naruse
8a269f85a0 * io.c (io_getc): set read_encoding to resulted one character
string. [ruby-dev:41023]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-20 18:19:01 +00:00
usa
ef3ea2dd89 * io.c: fixed the wrong description of rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-20 13:53:08 +00:00
usa
57e50f7f88 * io.c: rdoc. see [ruby-dev:40506].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-20 13:40:15 +00:00
nobu
a91d8b8c33 * io.c (internal_{read,write}_func, rb_{read,write}_internal):
reverted r27265, since now rb_thread_blocking_region() preserves
  errno.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-19 15:41:27 +00:00
mame
d6f289b0ff * io.c (rb_io_rewind, rb_io_eof): add rdoc. based on a patch from
Roger Pack in [ruby-core:26771] [Bug #2377].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-16 16:36:08 +00:00
nobu
8e7a682be0 * io.c (io_shift_cbuf): should terminate.
http://golf.shinh.org/p.rb?DECimal+number+to+BINary#Ruby


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-14 08:56:11 +00:00
kazu
0a6d09330c * io.c (rb_io_getline_fast, rb_io_getline_1): fix ARGF.lineno behavior. [ruby-core:25205]
* test/ruby/test_argf.rb (TestArgf#test_lineno3): add a test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-11 15:56:43 +00:00
nobu
92de2ed517 * io.c (internal_{read,write}_func, rb_{read,write}_internal):
preserve errno.  a patch from Takehiro Kubo in [ruby-core:29340].
  [ruby-core:28924]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-08 16:27:42 +00:00