From d1873dbcc89eb3138027d8e5c5e4c5b12420e797 Mon Sep 17 00:00:00 2001 From: Hadriel Kaplan Date: Thu, 20 Mar 2014 12:57:29 -0400 Subject: Fix Bug 9903: 'Clicking reload-file ignores selected file format reader' There's a relatively new feature in 1.11.3 to select a specific file format reader, instead of relying on magics or heuristics. If you select a file reader and open a file, open it, and then click the reload-file button or go to View->Reload or press the ctrl-R keymap, the file is reloaded but using the magic/heuristics again instead of the file format reader you previously chose. Likewise, the Lua relaod() function has the same issue (which is how I found this problem). I have tested this change by hand, using a Lua script, but I didn't add it to the testsuite because I need another change for my test script to work correctly. (an enhancement rather than a bug fix, which I'll submit separately) Change-Id: I48c2d9ea443e37fd9d41be43d6b6cd5a866d5b01 Reviewed-on: https://code.wireshark.org/review/764 Reviewed-by: Anders Broman --- tfshark.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tfshark.c') diff --git a/tfshark.c b/tfshark.c index 0489d3796a..9d6197118b 100644 --- a/tfshark.c +++ b/tfshark.c @@ -1425,6 +1425,8 @@ main(int argc, char *argv[]) relinquish_special_privs_perm(); print_current_user(); + /* TODO: if tfshark is ever changed to give the user a choice of which + open_routine reader to use, then the following needs to change. */ if (cf_open(&cfile, cf_name, WTAP_TYPE_AUTO, FALSE, &err) != CF_OK) { epan_cleanup(); return 2; @@ -2543,6 +2545,7 @@ cf_open(capture_file *cf, const char *fname, unsigned int type, gboolean is_temp cf->unsaved_changes = FALSE; cf->cd_t = ftap_file_type_subtype((struct ftap*)cf->wth); /**** XXX - DOESN'T WORK RIGHT NOW!!!! */ + cf->open_type = type; cf->count = 0; cf->drops_known = FALSE; cf->drops = 0; -- cgit v1.2.1