diff --git a/headers/private/file_systems/QueryParser.h b/headers/private/file_systems/QueryParser.h index 5fcb90d3e6..bcc6a29616 100644 --- a/headers/private/file_systems/QueryParser.h +++ b/headers/private/file_systems/QueryParser.h @@ -1285,10 +1285,12 @@ Expression::Init(const char* expr, const char** position) // Second & third passes: && and ||. int32 nodes = currentExpr->CountItems(); for (ops op = OP_AND; op <= OP_OR; op = (ops)(op + 1)) { - for (int32 i = 0; i < (currentExpr->CountItems() - 1); i++) { + for (int32 i = 0; i < (currentExpr->CountItems() - 1); ) { ExpressionNode* left = currentExpr->Array() + i; - if (left->op != op) + if (left->op != op) { + i++; continue; + } // Find the right-hand expression (may have to jump over now-unused nodes.) ExpressionNode* right = NULL;