Projects

Ticket #150 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

invalid strings with IO.pipe and readline

Reported by: macosforge@… Owned by: lsansonetti@…
Priority: major Milestone: MacRuby 0.5
Component: MacRuby Keywords:
Cc: macosforge@…

Description

Test case:

#!/usr/local/bin/macruby

r, w = IO.pipe
w.write("test\r\n")
l = r.readline("\r\n")

puts l.chomp("\r\n").inspect # ruby1.9: "test", macruby: "test\r\n"

puts l.match("e")[0].inspect # ruby1.9: "e", macruby: " "

Calling readline on an IO.pipe stream with a delimiter causes really odd strings to be returned, they don't behave correctly in a number of cases including the two shown. Possibly an encoding issue?

Change History

Changed 3 years ago by macosforge@…

  • cc macosforge@… added

Cc Me!

Changed 2 years ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to MacRuby 0.5

Seems to be fixed in trunk.

$ ./miniruby  t.rb 
"test"
"e"
$ ruby19  t.rb 
"test"
"e"
Note: See TracTickets for help on using tickets.