From a091e99cb9a126e6a2d0093a916450cf894be2f3 Mon Sep 17 00:00:00 2001 From: David Cole Date: Mon, 28 Sep 2009 17:14:53 -0400 Subject: [PATCH] Fix issue #8818 - escape quotes in the license file when using the DragNDrop cpack generator. Thanks to Clinton Stimpson for the patch. --- Source/CPack/cmCPackDragNDropGenerator.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index 07cb35e68..95324cf64 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -379,6 +379,13 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& toplevel, { std::string line; std::getline(ifs, line); + // escape quotes + std::string::size_type pos = line.find('\"'); + while(pos != std::string::npos) + { + line.replace(pos, 1, "\\\""); + pos = line.find('\"', pos+2); + } osf << " \"" << line << "\\n\"\n"; } osf << "};\n";