diff options
author | Guy Harris <guy@alum.mit.edu> | 1999-08-15 00:26:11 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 1999-08-15 00:26:11 +0000 |
commit | ea6a522b28b69794233e9700cc62d5277281e5e9 (patch) | |
tree | bdfb8964f1f6ea6f3b429822496ee249fb0fe027 /capture.c | |
parent | 9e58014e7facc8144b787199e0caa4b975ac0cb2 (diff) |
Split "load_cap_file()" into "open_cap_file()" and "read_cap_file()".
The former, which used to be called by "load_cap_file()", now just opens
the file and, if the open succeeds, closes any capture file we
previously had open, reinitializes any protocols that need
reinitialization, and saves information about the new capture file in
the "capture_file" structure to which it was passed a pointer. The
latter reads the file already opened by "read_cap_file()".
For "File/Open", call "open_cap_file()" before dismissing the file
selection box; if it fails, "open_cap_file()" will have popped up a
message box complaining about it - just return, leaving the file
selection box open so the user can, after dismissing the message box,
either try again with a different file name, or dismiss the file
selection box. (Other file selection boxes should be made to work the
same way.) If "open_cap_file()" succeeds, dismiss the file selection
box, and read the capture file in.
svn path=/trunk/; revision=492
Diffstat (limited to 'capture.c')
-rw-r--r-- | capture.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,7 +1,7 @@ /* capture.c * Routines for packet capture windows * - * $Id: capture.c,v 1.47 1999/08/14 23:47:19 guy Exp $ + * $Id: capture.c,v 1.48 1999/08/15 00:26:10 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -625,8 +625,8 @@ capture(void) { if (pch) { /* "pch" is non-NULL only if we successfully started a capture. If we haven't, there's no capture file to load. */ - err = load_cap_file(cf.save_file, NULL, &cf); - if (err == 0) { + if ((err = open_cap_file(cf.save_file, &cf)) == 0 && + (err = read_cap_file(cf.save_file, NULL, &cf)) == 0) { set_menu_sensitivity("/File/Save", TRUE); set_menu_sensitivity("/File/Save As...", FALSE); } |