lib/net/ftp/list/unix.rb in net-ftp-list-0.9 vs lib/net/ftp/list/unix.rb in net-ftp-list-1.0
- old
+ new
@@ -45,10 +45,16 @@
else ParserError 'Unknown LIST entry type.'
end
# TODO: Permissions, users, groups, date/time.
- @basename = match[21].match(/^(.+)(?:\s+\->.+)?$/)[0].strip
+ @basename = match[21].strip
+
+ # filenames with spaces will end up in the last match
+ @basename += match[22] unless match[22].nil?
+
+ # strip the symlink stuff we don't care about
+ @basename.sub!(/\s+\->.+$/, '') if @symlink
end
end
end
end