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

Unified Diff: tools/gn/source_file.cc

Issue 613083003: gn format: support absolute file system paths (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: help Created 6 years, 2 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
« tools/gn/command_format.cc ('K') | « tools/gn/command_format_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/source_file.cc
diff --git a/tools/gn/source_file.cc b/tools/gn/source_file.cc
index 7744850d5c5966ea048f529641b5683ba5ebbe88..b3eb560bac5b93d8a8f411c60aab7d99174ba8a7 100644
--- a/tools/gn/source_file.cc
+++ b/tools/gn/source_file.cc
@@ -64,6 +64,8 @@ base::FilePath SourceFile::Resolve(const base::FilePath& source_root) const {
}
converted.assign(&value_[2], value_.size() - 2);
+ if (source_root.empty())
+ return UTF8ToFilePath(converted).NormalizePathSeparatorsTo('/');
return source_root.Append(UTF8ToFilePath(converted))
.NormalizePathSeparatorsTo('/');
}
« tools/gn/command_format.cc ('K') | « tools/gn/command_format_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698