Commit 3ca39495 authored by jan.koester's avatar jan.koester
Browse files

gnu func ext

parent cccece31
Loading
Loading
Loading
Loading
+5 −5
Changes for executor.cpp: 5 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -607,8 +607,6 @@ int Executor::execute_rule(const std::string& target, const Rule* rule,

    auto order_only = expand_order_only(target, rule, stem);

    // Alle Rezeptzeilen dieser Regel zu einem einzigen Skript zusammenfügen,
    // damit mehrzeilige Shell-Blöcke (if/then/fi) im selben Shell-Kontext laufen.
    std::string full_recipe;
    bool is_silent = silent_;
    bool ignore_error = false;
@@ -618,7 +616,8 @@ int Executor::execute_rule(const std::string& target, const Rule* rule,
        std::string expanded = parser_.expand_with_automatic(
            rule->recipes[i], *mfp, target, first_prereq, prereqs, newer, stem, &order_only);

        if (i == 0) {
        // Jede einzelne Rezeptzeile auf Präfixe (@, -, +) prüfen und diese entfernen,
        // damit Befehle wie "@mkdir" sauber zu "mkdir" werden.
        size_t start = 0;
        while (start < expanded.size()) {
            if (expanded[start] == '@') { is_silent = true; start++; }
@@ -628,7 +627,8 @@ int Executor::execute_rule(const std::string& target, const Rule* rule,
            else break;
        }
        expanded = expanded.substr(start);
        }

        if (expanded.empty()) continue;

        if (i > 0) full_recipe += "\n";
        full_recipe += expanded;
@@ -640,7 +640,7 @@ int Executor::execute_rule(const std::string& target, const Rule* rule,
        std::cout << full_recipe << std::endl;
    }

    if (question_) return 1; // question mode
    if (question_) return 1;

    if (!dry_run_ || force_exec) {
        int rc = run_command(full_recipe, recipe_env);