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

Unified Diff: tools/gn/command_refs.cc

Issue 2160383002: Make `gn refs` handle files in data directories properly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn_refs_scripts
Patch Set: Created 4 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/command_refs.cc
diff --git a/tools/gn/command_refs.cc b/tools/gn/command_refs.cc
index fcd824a6842ea72bef034ec308055d02d8a17664..179535075ad6eee474a338ea80b673fc93efd38e 100644
--- a/tools/gn/command_refs.cc
+++ b/tools/gn/command_refs.cc
@@ -143,6 +143,9 @@ bool TargetContainsFile(const Target* target, const SourceFile& file) {
for (const auto& cur_file : target->data()) {
if (cur_file == file.value())
return true;
+ if (cur_file.back() == '/' &&
+ !strncmp(cur_file.c_str(), file.value().c_str(), cur_file.size() - 1))
brettw 2016/07/20 17:52:14 How about cur_file.back() == '/' && !base::StartsW
Dirk Pranke 2016/07/20 21:24:31 I figured there was some base routine for this but
+ return true;
}
if (target->action_values().script().value() == file.value())
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698