Project

General

Profile

Backport #6294

Please backport r35111 etc. (File::pos broken in Windows 1.9.3p125)

Added by h.shirosaki (Hiroshi Shirosaki) about 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
[ruby-core:44358]

Description

Backport request for #6179.
I created this thicket not to forget since #6179 is closed.

Revisions:
34785,35095,35098,35111,35152

#1

Updated by naruse (Yui NARUSE) about 8 years ago

  • Status changed from Open to Closed

This issue was solved with changeset r35328.
Hiroshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 34785,35095,35098,35111,35152: [Backport #6294]

* io.c (set_binary_mode_with_seek_cur): reorder function qualifiers.
* test/ruby/test_io.rb (TestIO#test_pos_with_getc): added.
  see [Bug #6179][ruby-core:43518]

* test/ruby/test_io.rb (TestIO#test_pos_with_getc): updated.
  see [ruby-core:43550]

* io.c (static int io_fflush): add the definition.
  Use it in set_binary_mode_with_seek_cur().

* io.c (set_binary_mode_with_seek_cur): refactoring to split the
  content into io_unread(). Fix the possibility of buffer overflow.

* io.c (io_unread): add new implementation for Windows. Previous one
  caused invalid cursor position using IO#pos with OS text mode. New
  one fixes the bug.

* test/ruby/test_io_m17n.rb
  (TestIO_M17N#test_pos_dont_move_cursor_position): add a test for
  above bug.
  [ruby-core:43497] [Bug #6179]

* io.c (io_unread): fixed memory leak.  report by nagachika via IRC.

Also available in: Atom PDF