diff options
| author | Dan Willemsen <dwillemsen@google.com> | 2018-02-08 08:18:42 +0000 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2018-02-08 08:18:42 +0000 |
| commit | 934c2eef9e10831cdfd24a367acf6d4f50975603 (patch) | |
| tree | c75669fd7602753774c8113a2fd5f3a6761e2f2a | |
| parent | 0cb976c71838c6c6bbe6710e29f641082c62e4c8 (diff) | |
| parent | e5288b11fc3d65b2c8a9f222959be0f910f948eb (diff) | |
| download | android_build_kati-934c2eef9e10831cdfd24a367acf6d4f50975603.tar.gz android_build_kati-934c2eef9e10831cdfd24a367acf6d4f50975603.tar.bz2 android_build_kati-934c2eef9e10831cdfd24a367acf6d4f50975603.zip | |
Merge remote-tracking branch 'aosp/upstream' into master am: 398aa879e9 am: e14ea3ab0b
am: e5288b11fc
Change-Id: I4d23dbca3573e98b369d897f257e00af7ad66894
| -rw-r--r-- | find.cc | 16 | ||||
| -rw-r--r-- | testcase/find_command.mk | 1 |
2 files changed, 11 insertions, 6 deletions
@@ -526,12 +526,16 @@ class FindCommandParser { while (true) { if (!GetNextToken(&tok)) return NULL; - if (tok != "-and" && tok != "-a") { - UngetToken(tok); - return c.release(); + if (tok == "-and" || tok == "-a") { + if (!GetNextToken(&tok) || tok.empty()) + return NULL; + } else { + if (tok != "-not" && tok != "\\!" && tok != "\\(" && tok != "-name" && + tok != "-type") { + UngetToken(tok); + return c.release(); + } } - if (!GetNextToken(&tok) || tok.empty()) - return NULL; unique_ptr<FindCond> r(ParseFact(tok)); if (!r.get()) { return NULL; @@ -562,7 +566,7 @@ class FindCommandParser { } // <expr> ::= <term> {<or> <term>} - // <term> ::= <fact> {<and> <fact>} + // <term> ::= <fact> {[<and>] <fact>} // <fact> ::= <not> <fact> | '\(' <expr> '\)' | <pred> // <not> ::= '-not' | '\!' // <and> ::= '-and' | '-a' diff --git a/testcase/find_command.mk b/testcase/find_command.mk index c3e8a07..b714879 100644 --- a/testcase/find_command.mk +++ b/testcase/find_command.mk @@ -67,6 +67,7 @@ endif $(call run_find, find testdir -name "file1") $(call run_find, find testdir -name "file1") $(call run_find, find testdir -name "*1") + $(call run_find, find testdir -name "*1" -name "file*") $(call run_find, find testdir -name "*1" -and -name "file*") $(call run_find, find testdir -name "*1" -or -name "file*") $(call run_find, find testdir -name "*1" -or -type f) |
