| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_util.h" | 5 #include "net/ftp/ftp_util.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/i18n/case_conversion.h" | 10 #include "base/i18n/case_conversion.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // Return path as-is. | 100 // Return path as-is. |
| 101 return vms_path; | 101 return vms_path; |
| 102 } | 102 } |
| 103 | 103 |
| 104 if (vms_path == "[]") | 104 if (vms_path == "[]") |
| 105 return "/"; | 105 return "/"; |
| 106 | 106 |
| 107 std::string result(vms_path); | 107 std::string result(vms_path); |
| 108 if (vms_path[0] == '[') { | 108 if (vms_path[0] == '[') { |
| 109 // It's a relative path. | 109 // It's a relative path. |
| 110 ReplaceFirstSubstringAfterOffset(&result, 0, "[.", ""); | 110 ReplaceFirstSubstringAfterOffset(&result, 0, "[.", std::string()); |
| 111 } else { | 111 } else { |
| 112 // It's an absolute path. | 112 // It's an absolute path. |
| 113 result.insert(0, "/"); | 113 result.insert(0, "/"); |
| 114 ReplaceSubstringsAfterOffset(&result, 0, ":[000000]", "/"); | 114 ReplaceSubstringsAfterOffset(&result, 0, ":[000000]", "/"); |
| 115 ReplaceSubstringsAfterOffset(&result, 0, ":[", "/"); | 115 ReplaceSubstringsAfterOffset(&result, 0, ":[", "/"); |
| 116 } | 116 } |
| 117 std::replace(result.begin(), result.end(), '.', '/'); | 117 std::replace(result.begin(), result.end(), '.', '/'); |
| 118 std::replace(result.begin(), result.end(), ']', '/'); | 118 std::replace(result.begin(), result.end(), ']', '/'); |
| 119 | 119 |
| 120 // Make sure the result doesn't end with a slash. | 120 // Make sure the result doesn't end with a slash. |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 while (!iter.end() && !u_isspace(iter.get())) | 367 while (!iter.end() && !u_isspace(iter.get())) |
| 368 iter.Advance(); | 368 iter.Advance(); |
| 369 } | 369 } |
| 370 | 370 |
| 371 base::string16 result(text.substr(iter.array_pos())); | 371 base::string16 result(text.substr(iter.array_pos())); |
| 372 TrimWhitespace(result, TRIM_ALL, &result); | 372 TrimWhitespace(result, TRIM_ALL, &result); |
| 373 return result; | 373 return result; |
| 374 } | 374 } |
| 375 | 375 |
| 376 } // namespace | 376 } // namespace |
| OLD | NEW |