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

Unified Diff: base/files/file_path.cc

Issue 213353004: GN: Move towards only using / on Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: only generate / in various places Created 6 years, 9 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
Index: base/files/file_path.cc
diff --git a/base/files/file_path.cc b/base/files/file_path.cc
index d47becbacca30815ca1284a3aad2a2d229be16cd..37bcd4c8bec9899a67219b6dc8dd045ec3a80b0a 100644
--- a/base/files/file_path.cc
+++ b/base/files/file_path.cc
@@ -1292,10 +1292,14 @@ void FilePath::StripTrailingSeparatorsInternal() {
}
FilePath FilePath::NormalizePathSeparators() const {
+ return NormalizePathSeparatorsTo(kSeparators[0]);
+}
+
+FilePath FilePath::NormalizePathSeparatorsTo(CharType separator) const {
#if defined(FILE_PATH_USES_WIN_SEPARATORS)
brettw 2014/04/02 17:34:28 How about DCHECKing here that separator == kSepara
scottmg 2014/04/02 20:20:19 Done.
StringType copy = path_;
- for (size_t i = 1; i < kSeparatorsLength; ++i) {
- std::replace(copy.begin(), copy.end(), kSeparators[i], kSeparators[0]);
+ for (size_t i = 0; i < kSeparatorsLength; ++i) {
+ std::replace(copy.begin(), copy.end(), kSeparators[i], separator);
}
return FilePath(copy);
#else
« no previous file with comments | « base/files/file_path.h ('k') | tools/gn/build_settings.cc » ('j') | tools/gn/build_settings.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698