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

Unified Diff: net/ftp/ftp_directory_listing_parser_ls.cc

Issue 472003: Compatibility updates for "ls -l" style FTP LIST response parser: (Closed)
Patch Set: fix a bug Created 11 years 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
Index: net/ftp/ftp_directory_listing_parser_ls.cc
diff --git a/net/ftp/ftp_directory_listing_parser_ls.cc b/net/ftp/ftp_directory_listing_parser_ls.cc
index f5136dbb6751ccc92362eace9b32babfca1da601..c7c4326c60fdb941db9f38b54d939c7218ff9378 100644
--- a/net/ftp/ftp_directory_listing_parser_ls.cc
+++ b/net/ftp/ftp_directory_listing_parser_ls.cc
@@ -28,7 +28,7 @@ bool LooksLikeUnixPermission(const string16& text) {
}
bool LooksLikeUnixPermissionsListing(const string16& text) {
- if (text.length() != 10)
+ if (text.length() < 10)
return false;
if (text[0] != 'b' && text[0] != 'c' && text[0] != 'd' &&
@@ -38,7 +38,8 @@ bool LooksLikeUnixPermissionsListing(const string16& text) {
return (LooksLikeUnixPermission(text.substr(1, 3)) &&
LooksLikeUnixPermission(text.substr(4, 3)) &&
- LooksLikeUnixPermission(text.substr(7, 3)));
+ LooksLikeUnixPermission(text.substr(7, 3)) &&
+ (text.substr(10).empty() || text.substr(10) == ASCIIToUTF16("+")));
}
string16 GetStringPartAfterColumns(const string16& text, int columns) {
« no previous file with comments | « net/ftp/ftp_directory_listing_buffer_unittest.cc ('k') | net/ftp/ftp_directory_listing_parser_ls_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698