From 3670d864203d3568297b13da8917e5c310048636 Mon Sep 17 00:00:00 2001 From: Ward Wouts Date: Sun, 20 Apr 2003 16:58:07 +0000 Subject: [PATCH] minor cleaning --- trunk/ripnews/encode/uuencode.rb | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/trunk/ripnews/encode/uuencode.rb b/trunk/ripnews/encode/uuencode.rb index 1d9f86e..072d138 100644 --- a/trunk/ripnews/encode/uuencode.rb +++ b/trunk/ripnews/encode/uuencode.rb @@ -1,6 +1,6 @@ ################################# # -# $Dwarf: uuencode.rb,v 1.1 2003/04/18 22:53:25 ward Exp $ +# $Dwarf: uuencode.rb,v 1.2 2003/04/20 16:34:11 ward Exp $ # $Source$ # # article.rb @@ -38,10 +38,10 @@ def _uudecode_file(file, outfile) mode = 0600 filename = "unknown" c = 0 - lines = file.pos + lines = file.pos # horrible assumption FH is at end of file percent = 0 mark = lines/100 - file.pos=0 + file.pos = 0 while (! file.eof) line = file.gets @@ -66,8 +66,6 @@ def _uudecode_file(file, outfile) end print "c: #{c} mark: #{mark} lines: #{lines}\n" if Debuglevel > 1 - print " UUdecoding...\n" - while (! file.eof) if Debuglevel > 1 c = file.pos @@ -83,8 +81,7 @@ def _uudecode_file(file, outfile) return mode, filename if line =~ /^end/ next if line =~ /[a-z]/ next if line == nil - next unless ((((line[0] - 32) & 077) + 2) / 3).to_i == - (line.length/4).to_i + next unless ((((line[0] - 32) & 077) + 2) / 3).to_i == (line.length/4).to_i outfile.print line.unpack("u") end @@ -128,8 +125,6 @@ def _uudecode_array(data) return false end - print "UUdecoding...\n" - while (i < data.length) if Debuglevel > 1 if c > mark @@ -145,8 +140,7 @@ def _uudecode_array(data) return mode, filename, decode if line =~ /^end/ next if line =~ /[a-z]/ next if line == nil - next unless ((((line[0] - 32) & 077) + 2) / 3).to_i == - (line.length/4).to_i + next unless ((((line[0] - 32) & 077) + 2) / 3).to_i == (line.length/4).to_i decode.concat(line.unpack("u")) end @@ -164,8 +158,7 @@ end def get_filename(data) if data.to_s =~ /^begin(\s+(\d+))?(\s+(.*?\S))?\s*$/m - filename = $4 - return filename + return $4 end return false end