Commit 22d668c7 authored by jan.koester's avatar jan.koester
Browse files

bugfix

parent 4f0ddbfc
Loading
Loading
Loading
Loading
+7 −4
Changes for parser.cpp: 7 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -186,8 +186,11 @@ bool Parser::handle_conditional(const std::string& line, Makefile& mf) {
            int depth = 0;
            size_t comma_pos = std::string::npos;
            for (size_t i = 1; i < args.size(); i++) {
                if (args[i] == '(' || (args[i] == '$' && i+1 < args.size() && args[i+1] == '('))
                    depth++;
                // Count plain parens only. '$(' contains a '(' that is matched
                // by its corresponding ')', so no special-casing is needed; a
                // separate '$' increment would double-count and hide the
                // top-level comma (e.g. ifeq ($(filter a,$(X)),)).
                if (args[i] == '(') { depth++; continue; }
                if (args[i] == ')') {
                    if (depth > 0) { depth--; continue; }
                    break;
@@ -232,8 +235,8 @@ bool Parser::handle_conditional(const std::string& line, Makefile& mf) {
            int depth = 0;
            size_t comma_pos = std::string::npos;
            for (size_t i = 1; i < args.size(); i++) {
                if (args[i] == '(' || (args[i] == '$' && i+1 < args.size() && args[i+1] == '('))
                    depth++;
                // Plain paren counting (see ifeq above for rationale).
                if (args[i] == '(') { depth++; continue; }
                if (args[i] == ')') {
                    if (depth > 0) { depth--; continue; }
                    break;