Commit 58c9d5cc authored by jan.koester's avatar jan.koester
Browse files

backsplash fix

parent e22aff57
Loading
Loading
Loading
Loading
+13 −0
Changes for parser.cpp: 13 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -438,6 +438,19 @@ void Parser::process_line(const std::string& line, Makefile& mf, Rule*& current_
            }
        }
    }
    // GNU make unescapes "\#" to a literal '#' (the backslash is consumed) so
    // that a '#' can appear in a value without starting a comment. Kbuild relies
    // on this for the asm-generic header wrappers:
    //   cmd_wrap = echo "\#include <asm-generic/$*.h>" > $@
    // Without unescaping, every generated wrapper got a literal "\#include",
    // an invalid directive, so basic types like __u32 were never defined.
    {
        size_t pos = 0;
        while ((pos = processed.find("\\#", pos)) != std::string::npos) {
            processed.erase(pos, 1);
            pos += 1;
        }
    }
    trimmed = trim(processed);
    if (trimmed.empty()) return;