fix yenc spul
This commit is contained in:
parent
e99c488703
commit
a465e50cdd
1 changed files with 19 additions and 12 deletions
|
|
@ -609,15 +609,19 @@ def _ydecode_file(file, outfile)
|
|||
if line =~ /^\=ybegin\s+(.*line\=.*)/
|
||||
m = $1
|
||||
print "ybegin match; rest: #{m}\n" if Debuglevel > 0
|
||||
if m =~ /^\s*(part\=(\d+)\s+)?(line\=(\d+))(\s*size\=(\d+))(\s*name=(.*))\Z/
|
||||
if m =~ /^\s*(part\=(\d+)\s+)?(total\=(\d+)\s+)?(line\=(\d+))(\s*size\=(\d+))(\s*name=(.*))\Z/
|
||||
part = $2.to_i
|
||||
linesize = $4.to_i
|
||||
totalsize = $6.to_i
|
||||
filename = $8
|
||||
total = $4.to_i
|
||||
linesize = $6.to_i
|
||||
totalsize = $8.to_i
|
||||
filename = $10
|
||||
print "found beginning"
|
||||
if part
|
||||
print " of part #{part}"
|
||||
end
|
||||
if total
|
||||
print " of #{total}"
|
||||
end
|
||||
print ", linesize = #{linesize}, size = #{size}, filename = #{filename}\n"
|
||||
break
|
||||
else
|
||||
|
|
@ -664,11 +668,12 @@ def _ydecode_file(file, outfile)
|
|||
if search_begin && line =~ /^\=ybegin\s+(.*)\Z/
|
||||
m = $1
|
||||
search_begin = 0
|
||||
if m =~ /^\s*(part\=(\d+)\s+)?(line\=(\d+))(\s*size\=(\d+))(\s*name=(.*))\Z/
|
||||
if m =~ /^\s*(part\=(\d+)\s+)?(total\=(\d+)\s+)?(line\=(\d+))(\s*size\=(\d+))(\s*name=(.*))\Z/
|
||||
part = $2.to_i
|
||||
linesize = $4.to_i
|
||||
totalsize = $6.to_i
|
||||
filename = $8
|
||||
total = $4.to_i
|
||||
linesize = $6.to_i
|
||||
totalsize = $8.to_i
|
||||
filename = $10
|
||||
print "found beginning of part #{part}, linesize = #{linesize}, size = #{size}, filename = #{filename}\n" if Debuglevel > 0
|
||||
end
|
||||
next
|
||||
|
|
@ -723,10 +728,12 @@ def _ydecode_array(data)
|
|||
if data[i] =~ /^\=ybegin\s+(.*line\=.*)/
|
||||
m = $1
|
||||
print "ybegin match; rest: #{m}\n" if Debuglevel > 0
|
||||
if m =~ /^(\s*(part\=(\d+)\s+)?line\=(\d+))(\s*size\=(\d+))(\s*name=(.*))\Z/
|
||||
linesize = $4.to_i
|
||||
size = $6.to_i
|
||||
filename = $8
|
||||
if m =~ /^\s*(part\=(\d+)\s+)?(total\=(\d+)\s+)?(line\=(\d+))(\s*size\=(\d+))(\s*name=(.*))\Z/
|
||||
part = $2.to_i
|
||||
total = $4.to_i
|
||||
linesize = $6.to_i
|
||||
size = $8.to_i
|
||||
filename = $10
|
||||
print "found beginning, linesize = #{linesize}, size = #{size}, filename = #{filename}\n" if Debuglevel > 0
|
||||
i += 1
|
||||
break
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue