Gentoo Archives: gentoo-commits

From: "Samuli Suominen (ssuominen)" <ssuominen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-sound/rosegarden/files: rosegarden-13.10-segfault_at_export_to_lilypond.patch
Date: Wed, 05 Feb 2014 11:26:31
Message-Id: 20140205112628.2FBDC2004C@flycatcher.gentoo.org
1 ssuominen 14/02/05 11:26:28
2
3 Added:
4 rosegarden-13.10-segfault_at_export_to_lilypond.patch
5 Log:
6 Migrate to usex. Apply upstream patch to avoid crashing at exporting to lilypond wrt #500344 by Ulf Dambacher
7
8 (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 4868F14D)
9
10 Revision Changes Path
11 1.1 media-sound/rosegarden/files/rosegarden-13.10-segfault_at_export_to_lilypond.patch
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/rosegarden/files/rosegarden-13.10-segfault_at_export_to_lilypond.patch?rev=1.1&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/rosegarden/files/rosegarden-13.10-segfault_at_export_to_lilypond.patch?rev=1.1&content-type=text/plain
15
16 Index: rosegarden-13.10-segfault_at_export_to_lilypond.patch
17 ===================================================================
18 Index: src/document/io/LilyPondExporter.cpp
19 ===================================================================
20 --- src/document/io/LilyPondExporter.cpp (revision 13602)
21 +++ src/document/io/LilyPondExporter.cpp (revision 13603)
22 @@ -706,13 +706,18 @@
23 std::string header = protectIllegalChars(metadata.get<String>(property));
24 if (property == headerCopyright) {
25 // replace a (c) or (C) with a real Copyright symbol
26 - int posCpy = header.find("c");
27 - if (!posCpy) posCpy = header.find("C");
28 - if (posCpy) {
29 - std::string leftOfCpy = header.substr(0, posCpy - 1);
30 - std::string rightOfCpy = header.substr(posCpy + 2);
31 + size_t posCpy = header.find("(c)");
32 + if (posCpy == std::string::npos) posCpy = header.find("(C)");
33 + if (posCpy != std::string::npos) {
34 + std::string leftOfCpy = header.substr(0, posCpy);
35 + std::string rightOfCpy = header.substr(posCpy + 3);
36 str << indent(col) << property << " = \\markup { \"" << leftOfCpy << "\""
37 << "\\char ##x00A9" << "\"" << rightOfCpy << "\" }" << std::endl;
38 + } else {
39 + if (header != "") {
40 + str << indent(col) << property << " = \""
41 + << header << "\"" << std::endl;
42 + }
43 }
44 } else if (header != "") {
45 str << indent(col) << property << " = \"" << header << "\"" << std::endl;