forked from osmocom/wireshark
This seems to fix the problem of trying to save over the top of an existing
capture on some occassions. svn path=/trunk/; revision=5872
This commit is contained in:
parent
fbaa0dd809
commit
eac7bf1188
21
file.c
21
file.c
|
@ -1,7 +1,7 @@
|
||||||
/* file.c
|
/* file.c
|
||||||
* File I/O routines
|
* File I/O routines
|
||||||
*
|
*
|
||||||
* $Id: file.c,v 1.280 2002/06/29 09:45:06 guy Exp $
|
* $Id: file.c,v 1.281 2002/07/15 05:14:26 sharpe Exp $
|
||||||
*
|
*
|
||||||
* Ethereal - Network traffic analyzer
|
* Ethereal - Network traffic analyzer
|
||||||
* By Gerald Combs <gerald@ethereal.com>
|
* By Gerald Combs <gerald@ethereal.com>
|
||||||
|
@ -1733,6 +1733,17 @@ save_cap_file(char *fname, capture_file *cf, gboolean save_filtered,
|
||||||
statusbar_push_file_msg(save_msg);
|
statusbar_push_file_msg(save_msg);
|
||||||
g_free(save_msg);
|
g_free(save_msg);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check that the from file is not the same as to file
|
||||||
|
* We do it here so we catch all cases ...
|
||||||
|
*/
|
||||||
|
if (strcmp(cf->filename, fname) == 0) {
|
||||||
|
simple_dialog(ESD_TYPE_CRIT, NULL,
|
||||||
|
"Can't save over current capture file: %s!",
|
||||||
|
cf->filename);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
if (!save_filtered && !save_marked && save_format == cf->cd_t) {
|
if (!save_filtered && !save_marked && save_format == cf->cd_t) {
|
||||||
/* We're not filtering packets, and we're saving it in the format
|
/* We're not filtering packets, and we're saving it in the format
|
||||||
it's already in, so we can just move or copy the raw data. */
|
it's already in, so we can just move or copy the raw data. */
|
||||||
|
@ -1777,14 +1788,6 @@ save_cap_file(char *fname, capture_file *cf, gboolean save_filtered,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (do_copy) {
|
if (do_copy) {
|
||||||
/* Check that the from file is not the same as to file */
|
|
||||||
if (strcmp(from_filename, fname) == 0) {
|
|
||||||
simple_dialog(ESD_TYPE_CRIT, NULL,
|
|
||||||
"Can't save over current capture file: %s!",
|
|
||||||
from_filename);
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Copy the file, if we haven't moved it. */
|
/* Copy the file, if we haven't moved it. */
|
||||||
if (!copy_binary_file(from_filename, fname))
|
if (!copy_binary_file(from_filename, fname))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
Loading…
Reference in New Issue