Display symlinks on FTP directory listings.

TEST=See bug.
http://crbug.com/21006

Review URL: http://codereview.chromium.org/197044

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25729 0039d316-1c4b-4281-b951-d872f2087c98
parent b0e221a8
...@@ -264,7 +264,24 @@ int URLRequestNewFtpJob::ProcessFtpDir(net::IOBuffer *buf, ...@@ -264,7 +264,24 @@ int URLRequestNewFtpJob::ProcessFtpDir(net::IOBuffer *buf,
result.fe_fname, false, file_size, result.fe_fname, false, file_size,
base::Time::FromLocalExploded(result.fe_time))); base::Time::FromLocalExploded(result.fe_time)));
break; break;
case net::FTP_TYPE_SYMLINK: case net::FTP_TYPE_SYMLINK: {
std::string filename(result.fe_fname, result.fe_fnlen);
// Parsers for styles 'U' and 'W' handle " -> " themselves.
if (state.lstyle != 'U' && state.lstyle != 'W') {
std::string::size_type offset = filename.find(" -> ");
if (offset != std::string::npos)
filename = filename.substr(0, offset);
}
if (StringToInt64(result.fe_size, &file_size)) {
file_entry.append(net::GetDirectoryListingEntry(
RawByteSequenceToFilename(filename.c_str(), encoding_),
filename, false, file_size,
base::Time::FromLocalExploded(result.fe_time)));
}
}
break;
case net::FTP_TYPE_JUNK: case net::FTP_TYPE_JUNK:
case net::FTP_TYPE_COMMENT: case net::FTP_TYPE_COMMENT:
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment