From: Joel VanderWerf Date: 2004-08-28T05:45:51+09:00 Subject: Re: [BUG] Frequent Segfault with stable snapshot 2004-08-23 Andrew Walrond wrote: > Since upgrading from a stable snapshot dated 2004-05-26 to a recent one dated > 2004-08-23, I am getting regular segfaults from a ruby script which has worked > flawlessly for ages. > > The output looks like this: > > /home/andrew/rubyx/lib/ruby/site_ruby/rubyx/strfile.rb:54: [BUG] Segmentation fault > ruby 1.8.2 (2004-08-22) [i686-linux] > > Aborted > > > The relevant portion of code is this ls() function added to the String object. > The offending line 54 is indicated with * > > class String > def ls() > fa=Dir.glob(self+"/{.,}?*") > * fa.delete(self+"/..") > return fa > end > end > > Anything relevant changed recently? > > Andrew Walrond This code works for me in both $ ruby -v ruby 1.9.0 (2004-08-25) [i686-linux] $ ruby-stable-snapshot -v ruby 1.8.2 (2004-08-24) [i686-linux] The exact code I am using is: class String def ls() fa=Dir.glob(self+"/{.,}?*") fa.delete(self+"/..") return fa end end p ".".ls