Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Unified Diff: net/url_request/url_request_new_ftp_job.cc

Issue 197044: Display symlinks on FTP directory listings. (Closed)
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_new_ftp_job.cc
diff --git a/net/url_request/url_request_new_ftp_job.cc b/net/url_request/url_request_new_ftp_job.cc
index a6b5e9f803067e4052798bfd55f60de71950ec49..9aeece17b304b7c1797f4f0a1884416086ed8b6c 100644
--- a/net/url_request/url_request_new_ftp_job.cc
+++ b/net/url_request/url_request_new_ftp_job.cc
@@ -265,6 +265,24 @@ int URLRequestNewFtpJob::ProcessFtpDir(net::IOBuffer *buf,
base::Time::FromLocalExploded(result.fe_time)));
break;
case net::FTP_TYPE_SYMLINK:
+ {
wtc 2009/09/09 01:25:46 Nit: the braces should be placed like this: cas
+ std::string filename(result.fe_fname, result.fe_fnlen);
+
+ // Parsers for styles 'U' and 'W' handle sequence " -> " themselves.
wtc 2009/09/09 01:25:46 What does "handle sequence" mean?
+ 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)) {
wtc 2009/09/09 01:25:46 Do you know if the result.fe_size field makes sens
+ 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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698