Fix QueryParser regression with underscores in field names

During the StringIterator rewrite, I broke parsing of field names with
underscores. Fixes LUCY-269.

TODO: Add a test case.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/87f3fb03
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/87f3fb03
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/87f3fb03

Branch: refs/heads/master
Commit: 87f3fb03a20335882f8f74a3170ebfdb9c5178b3
Parents: c8b648f
Author: Nick Wellnhofer <[email protected]>
Authored: Tue Sep 16 16:37:40 2014 +0200
Committer: Nick Wellnhofer <[email protected]>
Committed: Tue Sep 16 16:43:55 2014 +0200

----------------------------------------------------------------------
 core/Lucy/Search/QueryParser/QueryLexer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/87f3fb03/core/Lucy/Search/QueryParser/QueryLexer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/QueryParser/QueryLexer.c 
b/core/Lucy/Search/QueryParser/QueryLexer.c
index f070fb9..6c7c866 100644
--- a/core/Lucy/Search/QueryParser/QueryLexer.c
+++ b/core/Lucy/Search/QueryParser/QueryLexer.c
@@ -210,7 +210,7 @@ S_consume_field(StringIterator *iter) {
             DECREF(temp);
             return NULL;
         }
-        if (!(isalnum(code_point) || code_point != '_')) {
+        if (!(isalnum(code_point) || code_point == '_')) {
             DECREF(temp);
             return NULL;
         }

Reply via email to