Commit 24763de1 authored by jan.koester's avatar jan.koester
Browse files

test

parent f0f30816
Loading
Loading
Loading
Loading
+9 −0
Changes for src/shell.cpp: 9 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -1628,6 +1628,15 @@ std::vector<std::string> fresh::splitPipelineStages(const std::string &segment,
    std::string pendingBody;
    bool havePendingBody=false;

    // Depth of unclosed top-level '{' brace groups -- a '|' inside one
    // (e.g. "echo hi | tr a-z A-Z" nested inside "{ ...; } > file" used as
    // one whole pipeline stage) is that group's OWN internal pipe, not a
    // boundary between two stages of THIS pipeline; only extractBraceGroup
    // Body(), later, ever needs to see it. Mirrors the existing "$(...)"/
    // backtick protection just below, which the SAME '|' check already
    // respects.
    int braceDepth=0;

    auto flushStage=[&](){
        stages.push_back(current);
        current.clear();