aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>2007-03-30 00:23:19 +0000
committerwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>2007-03-30 00:23:19 +0000
commit5f9e7651999c10088c09d666937030eda5800fe6 (patch)
treeeab6c39524f3fb625213584b7f871635c64ca637 /gtk
parente2cda75a7695607293df191f5b42b3996f9e278e (diff)
From Sake Blok: fix bug 598 (http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=598)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21277 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'gtk')
-rw-r--r--gtk/follow_dlg.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/gtk/follow_dlg.c b/gtk/follow_dlg.c
index 2ca7e6ff7b..81970237dc 100644
--- a/gtk/follow_dlg.c
+++ b/gtk/follow_dlg.c
@@ -1153,7 +1153,25 @@ follow_add_to_gtk_text(char *buffer, size_t nchars, gboolean is_server,
* to be able to see the data we *should* see
* in the GtkText widget.
*/
- size_t i;
+ size_t i,j;
+ char *str;
+
+ /* XXX - workaround for bug 598
+ * convert CRLF to LF because the GTK copy function seems
+ * to convert CR to LF, resulting in double LF's
+ */
+ str = g_malloc(nchars + 1);
+ for (i = 0,j = 0; i < nchars; i++) {
+ if (i>0 && buffer[i-1] == '\r' && buffer[i] == '\n')
+ str[j-1] = buffer[i];
+ else
+ str[j++] = buffer[i];
+ }
+ nchars = nchars + j - i;
+ memcpy(buffer, str, nchars);
+ buffer[nchars] = 0;
+ g_free(str);
+ /* end of workaround for bug 598 */
for (i = 0; i < nchars; i++) {
if (buffer[i] == '\n' || buffer[i] == '\r')