Fix issue #8818 - escape quotes in the license file when using the DragNDrop cpack generator. Thanks to Clinton Stimpson for the patch.

This commit is contained in:
David Cole 2009-09-28 17:14:53 -04:00
parent 0f6c431180
commit a091e99cb9
1 changed files with 7 additions and 0 deletions

View File

@ -379,6 +379,13 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& toplevel,
{ {
std::string line; std::string line;
std::getline(ifs, 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 << " \"" << line << "\\n\"\n";
} }
osf << "};\n"; osf << "};\n";