Commit 8e42e174 authored by jan.koester's avatar jan.koester
Browse files

gnu func ext

parent e882a5b5
Loading
Loading
Loading
Loading
+2 −4
Changes for parser.cpp: 2 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -1446,10 +1446,8 @@ std::string Parser::func_shell(const std::string& cmd) const {
    // damit der an die Shell übergebene C-Code syntaktisch korrekt ankommt.
    size_t pos = 0;
    while ((pos = modified_cmd.find("printf '%b\\n'", pos)) != std::string::npos) {
        // Ersetze den printf-Aufruf durch einen echo -e Aufruf, der Backslash-Escapes plattmacht
        // Beispiel: printf '%b\n' 'code' -> echo -e 'code\n'
        modified_cmd.replace(pos, 12, "printf '%s\\n'");
        pos += 12;
        modified_cmd.replace(pos, 13, "printf '%s\\n'"); // Changed 12 to 13
        pos += 13;                                       // Advance by the correct length
    }

    FILE* pipe = popen(modified_cmd.c_str(), "r");