From 8e163522c70e8df74856be6552fe55253104a1cf Mon Sep 17 00:00:00 2001 From: Duncan Ogilvie Date: Sat, 3 Apr 2021 22:22:11 +0200 Subject: [PATCH] Add error checking for " at the end of injected cmake blocks --- src/cmkrlib/gen.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cmkrlib/gen.cpp b/src/cmkrlib/gen.cpp index a9c7f46..23b6c23 100644 --- a/src/cmkrlib/gen.cpp +++ b/src/cmkrlib/gen.cpp @@ -330,6 +330,9 @@ int generate_cmake(const char *path, bool root) { }; auto inject_cmake = [&ss, &tolf](const std::string &cmake) { if (!cmake.empty()) { + if (cmake.back() == '\"') { + throw std::runtime_error("Detected additional \" at the end of cmake block"); + } ss << tolf(cmake) << "\n\n"; } };