Commit 4e097be3 authored by jan.koester's avatar jan.koester
Browse files

bugfix

parent 82f8be5b
Loading
Loading
Loading
Loading
+5 −1
Changes for main.cpp: 5 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -340,7 +340,11 @@ int main(int argc, char* argv[]) {
                combined += " " + name + "=" + esc;
            }
        }
        std::string mkflags = makeplus::Parser::trim(combined);
        // Only strip LEADING whitespace: a trailing escaped space ("\ ") in the
        // override section is significant, and trimming it would leave a dangling
        // backslash that corrupts the value when a child make decodes MAKEFLAGS.
        std::string mkflags = combined;
        mkflags.erase(0, mkflags.find_first_not_of(" \t"));
        mf.variables["MAKEFLAGS"] = {mkflags, makeplus::VarFlavor::Simple, false};
        // MAKEFLAGS must be in the environment so a recursive $(MAKE) (a fresh
        // makeplus process) inherits the flags and the variable overrides above.