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

Unified Diff: net/ftp/ftp_directory_listing_parser_ls.cc

Issue 7584018: FTP: fix directory listing parsing for Hylafax (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 | « net/data/ftp/dir-listing-ls-28.expected ('k') | net/ftp/ftp_directory_listing_parser_ls_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b256da666acb2aa5af598b9ab7034512c635fbea..90985839e31c82343cfb437e3478eb53db6fb23b 100644
--- a/net/ftp/ftp_directory_listing_parser_ls.cc
+++ b/net/ftp/ftp_directory_listing_parser_ls.cc
@@ -33,7 +33,7 @@ bool LooksLikeUnixPermission(const string16& text) {
}
bool LooksLikeUnixPermissionsListing(const string16& text) {
- if (text.length() < 10)
+ if (text.length() < 7)
return false;
// Do not check the first character (entry type). There are many weird
@@ -44,9 +44,11 @@ bool LooksLikeUnixPermissionsListing(const string16& text) {
// separate this column from the next column (number of links), resulting
// in additional characters at the end. Also, sometimes there is a "+"
// sign at the end indicating the file has ACLs set.
+
+ // In fact, we don't even expect three "rwx" triplets of permission
+ // listing, as some FTP servers like Hylafax only send two.
return (LooksLikeUnixPermission(text.substr(1, 3)) &&
- LooksLikeUnixPermission(text.substr(4, 3)) &&
- LooksLikeUnixPermission(text.substr(7, 3)));
+ LooksLikeUnixPermission(text.substr(4, 3)));
}
bool LooksLikePermissionDeniedError(const string16& text) {
« no previous file with comments | « net/data/ftp/dir-listing-ls-28.expected ('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