Segmentation fault on gets

Does it help if you specify stdin explicitly? → $stdin.gets

Regards,

Dan

···

-----Original Message-----

I’m trying to do simple keyboard input:

a = “”
a = gets
puts a

His original script works fine for me. =\

C:\TMP>ruby -v
ruby 1.7.2 (2002-06-29) [i386-mswin32]

C:\TMP>cat tmp.rb
a = “”
a = gets
puts a

C:\TMP>ruby tmp.rb
foo <== I typed this.
foo <== ruby “typed” this.

···

— “Berger, Daniel” djberge@qwest.com wrote:

-----Original Message-----

I’m trying to do simple keyboard input:

a = “”
a = gets
puts a

Does it help if you specify stdin explicitly? → $stdin.gets

=====

Yahoo IM: michael_s_campbell


Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.

No, it fails promptly on the first keystroke.

Leon

···

-----Original Message-----
From: Berger, Daniel [mailto:djberge@qwest.com]
Sent: Tuesday, January 14, 2003 2:22 PM
To: ruby-talk ML
Subject: Re: Segmentation fault on gets

-----Original Message-----

I’m trying to do simple keyboard input:

a = “”
a = gets
puts a

Does it help if you specify stdin explicitly? → $stdin.gets

Regards,

Dan

Hmmm. OK, I’ll check out my system. That’s the most logical approach now.

Leon

···

-----Original Message-----
From: Michael Campbell [mailto:michael_s_campbell@yahoo.com]
Sent: Tuesday, January 14, 2003 2:36 PM
To: ruby-talk ML
Subject: Re: Segmentation fault on gets

— “Berger, Daniel” djberge@qwest.com wrote:

-----Original Message-----

I’m trying to do simple keyboard input:

a = “”
a = gets
puts a

Does it help if you specify stdin explicitly? → $stdin.gets

His original script works fine for me. =\

C:\TMP>ruby -v
ruby 1.7.2 (2002-06-29) [i386-mswin32]

C:\TMP>cat tmp.rb
a = “”
a = gets
puts a

C:\TMP>ruby tmp.rb
foo <== I typed this.
foo <== ruby “typed” this.

=====

Yahoo IM: michael_s_campbell


Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.