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

Unified Diff: net/ftp/ftp_util.cc

Issue 2610973002: Fix a pair of bugs in UNIX->VMS path conversion. (Closed)
Patch Set: Created 3 years, 11 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 | net/ftp/ftp_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ftp/ftp_util.cc
diff --git a/net/ftp/ftp_util.cc b/net/ftp/ftp_util.cc
index c61d986442b2863e0f250b620e84cd753d792a03..0e1f18d466276ed98b0475217e3f7867ae15fa15 100644
--- a/net/ftp/ftp_util.cc
+++ b/net/ftp/ftp_util.cc
@@ -45,12 +45,12 @@ std::string FtpUtil::UnixFilePathToVMS(const std::string& unix_path) {
// It's an absolute path.
if (tokens.empty()) {
- DCHECK_EQ(1U, unix_path.length());
+ // It's just "/" or a series of slashes, which all mean the same thing.
return "[]";
}
if (tokens.size() == 1)
- return unix_path.substr(1); // Drop the leading slash.
+ return tokens.front(); // Return without leading slashes.
std::string result(tokens[0] + ":[");
if (tokens.size() == 2) {
« no previous file with comments | « no previous file | net/ftp/ftp_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698