--- ntext.cc.orig	Fri Feb 22 16:51:22 2008
+++ ntext.cc	Fri Apr 28 13:19:18 2017
@@ -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 len, int colo
 
   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);
