fix filename matching

This commit is contained in:
Ward Wouts 2003-04-20 20:15:34 +00:00
parent be01c244a4
commit 0b1249b372
2 changed files with 17 additions and 8 deletions

View file

@ -1,6 +1,6 @@
################################# #################################
# #
# $Dwarf: uuencode.rb,v 1.3 2003/04/20 16:58:07 ward Exp $ # $Dwarf: uuencode.rb,v 1.4 2003/04/20 18:02:51 ward Exp $
# $Source$ # $Source$
# #
# article.rb # article.rb
@ -159,9 +159,14 @@ def is_uuencoded(data)
end end
def get_filename(data) def get_filename(data)
if data.to_s =~ /^begin(\s+(\d+))?(\s+(.*?\S))?\s*$/m i = 0
while i < data.length
line = data[i]
if line =~ /^begin(\s+(\d+))?(\s+(.*?\S))?\s*$/m
return $4 return $4
end end
i += 1
end
return false return false
end end

View file

@ -1,6 +1,6 @@
################################# #################################
# #
# $Dwarf: yenc.rb,v 1.2 2003/04/20 16:33:31 ward Exp $ # $Dwarf: yenc.rb,v 1.3 2003/04/20 18:31:17 ward Exp $
# $Source$ # $Source$
# #
# article.rb # article.rb
@ -297,11 +297,15 @@ def is_yencoded(data)
end end
def get_filename(data) def get_filename(data)
if data.to_s =~ /=ybegin\s*(part\=(\d+)\s+)?(total\=(\d+)\s+)?(line\=(\d+))(\s*size\=(\d+))(\s*name=(.*?\S))\s*$/m i = 0
while i < data.length
line = data[i]
if line =~ /=ybegin\s*(part\=(\d+)\s+)?(total\=(\d+)\s+)?(line\=(\d+))(\s*size\=(\d+))(\s*name=(.*?\S))\s*$/m
return $10 return $10
else
return false
end end
i += 1
end
return false
end end
end # class end # class