hopelijk fixed dit een threading probleem, zo nee, dan zullen er toch mutexes gebruikt moeten worden...

This commit is contained in:
Ward Wouts 2005-01-31 14:08:33 +00:00
parent fa21a99055
commit 42347d5f66

View file

@ -1,4 +1,4 @@
# $Dwarf: yenc.rb,v 1.11 2004/10/18 08:13:47 ward Exp $ # $Dwarf: yenc.rb,v 1.12 2004/10/18 18:35:39 ward Exp $
# $Source$ # $Source$
# #
@ -27,10 +27,12 @@ class << self
Debuglevel = 0 Debuglevel = 0
def ydecode(data, outfile=nil) def ydecode(data, outfile=nil)
unless @ymap
@ymap = {} @ymap = {}
(-106..255).each do |b| (-106..255).each do |b|
@ymap[b]=((b-42)%256) @ymap[b]=((b-42)%256)
end end
end
case data.class.to_s case data.class.to_s
when "Array" when "Array"
@ -62,7 +64,12 @@ def _ydecode_line(line)
line[i] -= 64 line[i] -= 64
end end
end end
ostr << @ymap[line[i]] begin
ostr << @ymap[line[i].to_i]
rescue TypeError
puts "this should not happen!!!"
puts "line[i] contents: '#{line[i]}'\n"
end
i += 1 i += 1
end end
return ostr return ostr