diff options
author | Guy Harris <guy@alum.mit.edu> | 2004-10-07 03:50:16 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2004-10-07 03:50:16 +0000 |
commit | ab9b8d36b55fbeefb22dac721193b79e578a8929 (patch) | |
tree | 07b4c812d77e1f31fdd5e928891c5325f47c1775 /gtk/capture_dlg.c | |
parent | 5a244d166b223e904fdea142a495eba38f9fcb28 (diff) |
Save the capture filter in the recent list iff the capture succeeds.
Checking the syntax involves opening a device, which
1) might not succeed
and
2) might tie up a BPF device or otherwise consume resources
so we leave it up to the capture operation to do the checking.
svn path=/trunk/; revision=12225
Diffstat (limited to 'gtk/capture_dlg.c')
-rw-r--r-- | gtk/capture_dlg.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gtk/capture_dlg.c b/gtk/capture_dlg.c index d44fd191ae..d507f55515 100644 --- a/gtk/capture_dlg.c +++ b/gtk/capture_dlg.c @@ -1296,10 +1296,6 @@ capture_prep_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w) { cfile.iface = g_strdup(if_name); g_free(entry_text); - /* Add this capture filter to the recent capture filter list if it passes a syntax check */ - if(check_capture_filter_syntax(cfile.iface, (gchar *) gtk_entry_get_text(GTK_ENTRY(filter_te)))) - cfilter_combo_add_recent((gchar *) gtk_entry_get_text(GTK_ENTRY(filter_te))); - capture_opts.linktype = GPOINTER_TO_INT(OBJECT_GET_DATA(linktype_om, E_CAP_OM_LT_VALUE_KEY)); @@ -1464,7 +1460,11 @@ capture_prep_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w) { window_destroy(GTK_WIDGET(parent_w)); - do_capture(save_file); + if (do_capture(save_file)) { + /* The capture succeeded, which means the capture filter syntax is + valid; add this capture filter to the recent capture filter list. */ + cfilter_combo_add_recent(cfile.cfilter); + } if (save_file != NULL) g_free(save_file); } |