changeset 994:f1c7b03f944d

Removed carriage return stripping from GTK3, it is not needed.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 07 May 2011 19:46:58 +0000
parents 98d73c9e81fc
children 65ccdda2d743
files gtk3/dw.c
diffstat 1 files changed, 2 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/gtk3/dw.c	Sat May 07 19:44:51 2011 +0000
+++ b/gtk3/dw.c	Sat May 07 19:46:58 2011 +0000
@@ -4267,21 +4267,6 @@
     return 0L;
 }
 
-void _strip_cr(char *dest, char *src)
-{
-   int z, x = 0;
-
-   for(z=0;z<strlen(src);z++)
-   {
-      if(src[z] != '\r')
-      {
-         dest[x] = src[z];
-         x++;
-      }
-   }
-   dest[x] = 0;
-}
-
 /*
  * Adds text to an MLE box and returns the current point.
  * Parameters:
@@ -4301,18 +4286,14 @@
 
       if(tmp && GTK_IS_TEXT_VIEW(tmp))
       {
-         char *impbuf = malloc(strlen(buffer)+1);
          GtkTextBuffer *tbuffer;
          GtkTextIter iter;
 
-         _strip_cr(impbuf, buffer);
-
          tbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tmp));
          gtk_text_buffer_get_iter_at_offset(tbuffer, &iter, startpoint);
          gtk_text_buffer_place_cursor(tbuffer, &iter);
-         gtk_text_buffer_insert_at_cursor(tbuffer, impbuf, -1);
-         tmppoint = (startpoint > -1 ? startpoint : 0) + strlen(impbuf);
-         free(impbuf);
+         gtk_text_buffer_insert_at_cursor(tbuffer, buffer, -1);
+         tmppoint = (startpoint > -1 ? startpoint : 0) + strlen(buffer);
       }
    }
    DW_MUTEX_UNLOCK;