diff options
author | Jaap Keuter <jaap.keuter@xs4all.nl> | 2006-04-26 06:37:46 +0000 |
---|---|---|
committer | Jaap Keuter <jaap.keuter@xs4all.nl> | 2006-04-26 06:37:46 +0000 |
commit | 7f5fc8b8d95be284a0769605efb24d6752dd84db (patch) | |
tree | ed20ad6d1a8914fbc47760a860f8f5b0bb78f4e9 /gtk/follow_dlg.c | |
parent | f9468fe33f35dfb0fdbc25cc6ae84ffd3b330963 (diff) |
Workaround for bug 852. Force a line break so that the text view doesn't blow up on excessive long lines.
svn path=/trunk/; revision=18001
Diffstat (limited to 'gtk/follow_dlg.c')
-rw-r--r-- | gtk/follow_dlg.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/gtk/follow_dlg.c b/gtk/follow_dlg.c index cc290dd74e..cb3d0c36b6 100644 --- a/gtk/follow_dlg.c +++ b/gtk/follow_dlg.c @@ -177,7 +177,7 @@ follow_stream_cb(GtkWidget * w, gpointer data _U_) follow_info_t *follow_info; /* we got tcp so we can follow */ - if (cfile.edt->pi.ipproto != 6) { + if (cfile.edt->pi.ipproto != IP_PROTO_TCP) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Error following stream. Please make\n" "sure you have a TCP packet selected."); @@ -274,7 +274,7 @@ follow_stream_cb(GtkWidget * w, gpointer data _U_) vbox = gtk_vbox_new(FALSE, 6); gtk_container_add(GTK_CONTAINER(streamwindow), vbox); - /* content frame */ + /* content frame */ if (incomplete_tcp_stream) { stream_fr = gtk_frame_new("Stream Content (incomplete)"); } else { @@ -985,6 +985,7 @@ follow_add_to_gtk_text(char *buffer, size_t nchars, gboolean is_server, #endif #if GTK_MAJOR_VERSION >= 2 || GTK_MINOR_VERSION >= 3 + gboolean line_break = FALSE; /* While our isprint() hack is in place, we * have to use convert some chars to '.' in order * to be able to see the data we *should* see @@ -994,11 +995,21 @@ follow_add_to_gtk_text(char *buffer, size_t nchars, gboolean is_server, for (i = 0; i < nchars; i++) { if (buffer[i] == '\n' || buffer[i] == '\r') + { + line_break = TRUE; continue; + } if (! isprint(buffer[i])) { buffer[i] = '.'; } } + + /* XXX - workaround for bug 852 + * Force a line break so that the text view + * doesn't blow up on excessive long lines. + */ + if (line_break == FALSE) + buffer[--i] = '\n'; #endif #if GTK_MAJOR_VERSION < 2 |