diff options
author | Josh Rickmar <jrick@devio.us> | 2012-05-10 11:23:17 -0400 |
---|---|---|
committer | Josh Rickmar <jrick@devio.us> | 2012-05-15 11:49:52 -0400 |
commit | be4b65a88e997bb7cdafdf784fc06e158fe100e5 (patch) | |
tree | 9888555675415fad13a2390819b38b2da3ee2bdf | |
parent | 9cc9be30cb6004404eccf206357498299a7baf53 (diff) | |
download | xombrero-be4b65a88e997bb7cdafdf784fc06e158fe100e5.tar.gz |
Fix the behavior of search_string so it matches the manpage. An empty
search_string now will not cause the search box to be drawn, and if search_string is dynamically changed at runtime to "\0", a show_oops warning is shown instead of loading the "broken" page.
-rw-r--r-- | xxxterm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xxxterm.c b/xxxterm.c index 4455743..35cdde7 100644 --- a/xxxterm.c +++ b/xxxterm.c @@ -3318,7 +3318,7 @@ activate_search_entry_cb(GtkWidget* entry, struct tab *t) return; } - if (search_string == NULL) { + if (search_string == NULL || strlen(search_string) == 0) { show_oops(t, "no search_string"); return; } @@ -6468,7 +6468,7 @@ create_toolbar(struct tab *t) gtk_box_pack_start(GTK_BOX(b), eb1, TRUE, TRUE, 0); /* search entry */ - if (search_string) { + if (search_string != NULL && strlen(search_string) != 0) { GtkWidget *eb2; t->search_entry = gtk_entry_new(); gtk_entry_set_width_chars(GTK_ENTRY(t->search_entry), 30); |