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

Side by Side Diff: net/ftp/ftp_directory_listing_parser_vms.cc

Issue 11418296: FTP: misc fixes resulting from my testing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixes Created 8 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 unified diff | Download patch
« no previous file with comments | « net/ftp/ftp_directory_listing_parser_unittest.cc ('k') | net/ftp/ftp_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/ftp/ftp_directory_listing_parser_vms.h" 5 #include "net/ftp/ftp_directory_listing_parser_vms.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/string_split.h" 10 #include "base/string_split.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 bool LooksLikeVmsUserIdentificationCode(const string16& input) { 118 bool LooksLikeVmsUserIdentificationCode(const string16& input) {
119 if (input.length() < 2) 119 if (input.length() < 2)
120 return false; 120 return false;
121 return input[0] == '[' && input[input.length() - 1] == ']'; 121 return input[0] == '[' && input[input.length() - 1] == ']';
122 } 122 }
123 123
124 bool LooksLikePermissionDeniedError(const string16& text) { 124 bool LooksLikePermissionDeniedError(const string16& text) {
125 static const char* kPermissionDeniedMessages[] = { 125 static const char* kPermissionDeniedMessages[] = {
126 "%RMS-E-PRV", 126 "%RMS-E-PRV",
127 "%SYSTEM-F-NOPRIV",
127 "privilege", 128 "privilege",
128 }; 129 };
129 130
130 for (size_t i = 0; i < arraysize(kPermissionDeniedMessages); i++) { 131 for (size_t i = 0; i < arraysize(kPermissionDeniedMessages); i++) {
131 if (text.find(ASCIIToUTF16(kPermissionDeniedMessages[i])) != string16::npos) 132 if (text.find(ASCIIToUTF16(kPermissionDeniedMessages[i])) != string16::npos)
132 return true; 133 return true;
133 } 134 }
134 135
135 return false; 136 return false;
136 } 137 }
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 257
257 entries->push_back(entry); 258 entries->push_back(entry);
258 } 259 }
259 260
260 // The only place where we return true is after receiving the "Total" line, 261 // The only place where we return true is after receiving the "Total" line,
261 // that should be present in every VMS listing. 262 // that should be present in every VMS listing.
262 return false; 263 return false;
263 } 264 }
264 265
265 } // namespace net 266 } // namespace net
OLDNEW
« no previous file with comments | « net/ftp/ftp_directory_listing_parser_unittest.cc ('k') | net/ftp/ftp_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698