diff options
author | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-08-11 15:06:45 +0900 |
---|---|---|
committer | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-08-11 15:13:52 +0900 |
commit | 9a802b0a17fe3e2bd17fb5b7a9334f77e84c4193 (patch) | |
tree | 1b0d172bff5b8b04c7bac40224161dab8c4042c5 /find.cc | |
parent | f6df3344fdaf7e10deb36a7f93d7884cc1b26c54 (diff) | |
download | android_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.cc | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -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); |