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$
#
# article.rb
@ -159,8 +159,13 @@ def is_uuencoded(data)
end
def get_filename(data)
if data.to_s =~ /^begin(\s+(\d+))?(\s+(.*?\S))?\s*$/m
return $4
i = 0
while i < data.length
line = data[i]
if line =~ /^begin(\s+(\d+))?(\s+(.*?\S))?\s*$/m
return $4
end
i += 1
end
return false
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$
#
# article.rb
@ -297,11 +297,15 @@ def is_yencoded(data)
end
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
return $10
else
return false
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
end
i += 1
end
return false
end
end # class