lib/net/ftp/list/unix.rb in net-ftp-list-3.2.9 vs lib/net/ftp/list/unix.rb in net-ftp-list-3.2.10
- old
+ new
@@ -68,19 +68,23 @@
# 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
+ if symlink
+ basename.sub!(/\s+\->(.+)$/, '')
+ symlink_destination = $1.strip
+ end
emit_entry(
raw,
:dir => dir,
:file => file,
:device => device,
:symlink => symlink,
:filesize => filesize,
:basename => basename,
+ :symlink_destination => symlink_destination,
:mtime => mtime
)
end
end