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

Unified Diff: tools/gn/string_utils.cc

Issue 440333002: Support more configurability in GN toolchains (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unsigned check Created 6 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 | « tools/gn/string_utils.h ('k') | tools/gn/substitution_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/string_utils.cc
diff --git a/tools/gn/string_utils.cc b/tools/gn/string_utils.cc
index 60e4e8c16c5cb44fc140edab69457189518fff73..2603c15a31e2a69927d39dc4cd299f024a243e88 100644
--- a/tools/gn/string_utils.cc
+++ b/tools/gn/string_utils.cc
@@ -168,3 +168,10 @@ std::string RemovePrefix(const std::string& str, const std::string& prefix) {
str.compare(0, prefix.size(), prefix) == 0);
return str.substr(prefix.size());
}
+
+void TrimTrailingSlash(std::string* str) {
+ if (!str->empty()) {
+ DCHECK((*str)[str->size() - 1] == '/');
+ str->resize(str->size() - 1);
+ }
+}
« no previous file with comments | « tools/gn/string_utils.h ('k') | tools/gn/substitution_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698