aboutsummaryrefslogtreecommitdiffstats
path: root/find.cc
diff options
context:
space:
mode:
authorShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-08-11 15:06:45 +0900
committerShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-08-11 15:13:52 +0900
commit9a802b0a17fe3e2bd17fb5b7a9334f77e84c4193 (patch)
tree1b0d172bff5b8b04c7bac40224161dab8c4042c5 /find.cc
parentf6df3344fdaf7e10deb36a7f93d7884cc1b26c54 (diff)
downloadandroid_build_kati-9a802b0a17fe3e2bd17fb5b7a9334f77e84c4193.tar.gz
android_build_kati-9a802b0a17fe3e2bd17fb5b7a9334f77e84c4193.tar.bz2
android_build_kati-9a802b0a17fe3e2bd17fb5b7a9334f77e84c4193.zip
[C++] Check testdir before chdir
So there will be no unnecessary error messages.
Diffstat (limited to 'find.cc')
-rw-r--r--find.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/find.cc b/find.cc
index 9f5332d..75db6d9 100644
--- a/find.cc
+++ b/find.cc
@@ -674,6 +674,19 @@ class FindEmulatorImpl : public FindEmulator {
is_initialized_ = true;
}
+ if (!fc.testdir.empty()) {
+ if (!CanHandle(fc.testdir)) {
+ LOG("FindEmulator: Cannot handle test dir (%.*s): %s",
+ SPF(fc.testdir), cmd.c_str());
+ return false;
+ }
+ if (!root_->FindDir(fc.testdir)) {
+ LOG("FindEmulator: Test dir (%.*s) not found: %s",
+ SPF(fc.testdir), cmd.c_str());
+ return true;
+ }
+ }
+
if (!fc.chdir.empty()) {
if (!CanHandle(fc.chdir)) {
LOG("FindEmulator: Cannot handle chdir (%.*s): %s",
@@ -688,19 +701,6 @@ class FindEmulatorImpl : public FindEmulator {
}
}
- if (!fc.testdir.empty()) {
- if (!CanHandle(fc.testdir)) {
- LOG("FindEmulator: Cannot handle test dir (%.*s): %s",
- SPF(fc.testdir), cmd.c_str());
- return false;
- }
- if (!root_->FindDir(fc.testdir)) {
- LOG("FindEmulator: Test dir (%.*s) not found: %s",
- SPF(fc.testdir), cmd.c_str());
- return true;
- }
- }
-
const size_t orig_out_size = out->size();
for (StringPiece finddir : fc.finddirs) {
const string dir = ConcatDir(fc.chdir, finddir);