ports/games/eboard/files/patch-ntext.cc
Jan Beich 826aa9746c games/eboard: unbreak with libc++ 3.9
ntext.cc:247:5: error: assigning to 'char *' from incompatible type 'const char *'
  p = strchr(text, '\n');
    ^ ~~~~~~~~~~~~~~~~~~

Reported by:	pkg-fallout
2017-02-01 12:26:15 +00:00

24 lines
606 B
C++

--- ntext.cc.orig 2008-02-22 15:51:22 UTC
+++ ntext.cc
@@ -237,7 +237,7 @@ void NText::setBG(int c) {
void NText::append(const char *text, int len, int color) {
int i;
NLine *nl;
- char *p;
+ const char *p;
if (len < 0) {
discardExcess();
@@ -246,10 +246,8 @@ void NText::append(const char *text, int
p = strchr(text, '\n');
if (p!=NULL) {
- *p = 0;
- i = strlen(text);
- nl = new NLine(text, color);
- *p = '\n';
+ i = p - text;
+ nl = new NLine(text, color, i);
lines.push_back(nl);
formatLine(lines.size()-1);
append(&p[1], len-(i+1), color);