# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1304797491 0 # Node ID 98d73c9e81fc9d18c23b1caf787937a5dd253344 # Parent 2d80b4dcff9aa897141ec311f4ff05950655b560 Remove carriage return stripping for GTK2... it is only needed in GTK1. diff -r 2d80b4dcff9a -r 98d73c9e81fc gtk/dw.c --- a/gtk/dw.c Sat May 07 19:39:45 2011 +0000 +++ b/gtk/dw.c Sat May 07 19:44:51 2011 +0000 @@ -4674,6 +4674,7 @@ return 0L; } +#if GTK_MAJOR_VERSION < 2 void _strip_cr(char *dest, char *src) { int z, x = 0; @@ -4688,6 +4689,7 @@ } dest[x] = 0; } +#endif /* * Adds text to an MLE box and returns the current point. @@ -4713,18 +4715,14 @@ #if GTK_MAJOR_VERSION > 1 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); } #else GdkFont *font = (GdkFont *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_gdkfont");