diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-09 16:31:39 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-09 16:31:39 +0000 |
commit | 97fee079f76d2f7099f4fce9750fe2dcb62609a0 (patch) | |
tree | 3d19ba51e64859e0229ac298cfb2884a6e01ae0a /net/url_request | |
parent | b0e221a8400fabd68a066e613a4f25d4b4505812 (diff) | |
download | chromium_src-97fee079f76d2f7099f4fce9750fe2dcb62609a0.zip chromium_src-97fee079f76d2f7099f4fce9750fe2dcb62609a0.tar.gz chromium_src-97fee079f76d2f7099f4fce9750fe2dcb62609a0.tar.bz2 |
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
Diffstat (limited to 'net/url_request')
-rw-r--r-- | net/url_request/url_request_new_ftp_job.cc | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/net/url_request/url_request_new_ftp_job.cc b/net/url_request/url_request_new_ftp_job.cc index 0083e23..f3d8aed 100644 --- a/net/url_request/url_request_new_ftp_job.cc +++ b/net/url_request/url_request_new_ftp_job.cc @@ -264,7 +264,24 @@ int URLRequestNewFtpJob::ProcessFtpDir(net::IOBuffer *buf, result.fe_fname, false, file_size, base::Time::FromLocalExploded(result.fe_time))); 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_COMMENT: break; |