[#18121] [Ruby 1.8.7 - Bug #405] (Open) ssl.rb:31: [BUG] Bus Error — Anonymous <redmine@...>

Issue #405 has been reported by Anonymous.

14 messages 2008/08/04

[#18130] Re: New array methods cycle, choice, shuffle (plus bug in cycle) — Brian Candler <B.Candler@...>

> Seriously though... Array.first is a noun.

10 messages 2008/08/05

[#18319] NEW Command: absolute_path() -- — "C.E. Thornton" <admin@...>

Core,

14 messages 2008/08/16
[#18321] Re: NEW Command: absolute_path() -- — Yukihiro Matsumoto <matz@...> 2008/08/18

Hi,

[#18381] [Bug #496] DRb.start_service(nil) is very slow — Hongli Lai <redmine@...>

Bug #496: DRb.start_service(nil) is very slow

11 messages 2008/08/25

[ruby-core:18092] [Ruby 1.8 - Bug #400] (Open) Possible bug in IO#ungetc

From: Anonymous <redmine@...>
Date: 2008-08-03 01:13:57 UTC
List: ruby-core #18092
Issue #400 has been reported by Anonymous.

----------------------------------------
Bug #400: Possible bug in IO#ungetc
http://redmine.ruby-lang.org/issues/show/400

Author: Anonymous
Status: Open
Priority: Normal
Assigned to: 
Category: 
Target version: 


According to the documentation for IO#ungetc:

bq.
   "Only one character may be pushed back before a subsequent
   read operation (that is, you will be able to read only the
   last of several characters that have been pushed back)."

But that doesn't seem to be the case:

file.txt   
   Voici la ligne une.
   Qui テδィ la linea due.
   Aquテδュ estテδ。 la lテδュnea tres.
   Ist hier Linie vier.
   Estテδ。 aqui a linha cinco.
   Here is line six.

Rubyspec:

    @file = File.open("file.txt", "r")
    @file.getc
    10.times { @file.ungetc(90) }
    @file.ungetc(80)
    @file.read(1).should == "P"
    @file.readline.should == "oici la ligne une.\n"

    #=> IO#ungetc pushing back only one character FAILED
        Expected "ZZZZZZZZZZoici la ligne une.\n"
        to equal "oici la ligne une.\n"

Are we misunderstanding the documentation and this works as expected or is it a bug indeed?


----------------------------------------
http://redmine.ruby-lang.org

In This Thread

Prev Next