hopelijk fixed dit een threading probleem, zo nee, dan zullen er toch mutexes gebruikt moeten worden...
This commit is contained in:
parent
fa21a99055
commit
42347d5f66
1 changed files with 12 additions and 5 deletions
|
|
@ -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,9 +27,11 @@ class << self
|
||||||
Debuglevel = 0
|
Debuglevel = 0
|
||||||
|
|
||||||
def ydecode(data, outfile=nil)
|
def ydecode(data, outfile=nil)
|
||||||
@ymap = {}
|
unless @ymap
|
||||||
(-106..255).each do |b|
|
@ymap = {}
|
||||||
@ymap[b]=((b-42)%256)
|
(-106..255).each do |b|
|
||||||
|
@ymap[b]=((b-42)%256)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
case data.class.to_s
|
case data.class.to_s
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue