aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-06-02 16:59:47 +0000
committerGuy Harris <guy@alum.mit.edu>2012-06-02 16:59:47 +0000
commit5f0c275f0f68634bf3d667ca3a65499f0bc2166e (patch)
tree75382088ef37fc51280d36360a411b962536fea3
parent4cbb31e99c1d23f2422584def34285759ab204d5 (diff)
If the rename in a safe "Save As" fails, the current file's name has
*not* changed; what we need to, on Windows, reopen is the *old* file name, not the name we're saving as. svn path=/trunk/; revision=43003
-rw-r--r--file.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/file.c b/file.c
index 5248ba3fda..2088d33195 100644
--- a/file.c
+++ b/file.c
@@ -3983,12 +3983,13 @@ cf_save_packets(capture_file *cf, const char *fname, guint save_format,
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
file_rename_error_message(errno), fname);
#ifdef _WIN32
- /* Attempt to reopen the random file descriptor using fname.
- (At this point, the sequential file descriptor is closed.) */
- if (!wtap_fdreopen(cf->wth, fname, &err)) {
+ /* Attempt to reopen the random file descriptor using the
+ current file's filename. (At this point, the sequential
+ file descriptor is closed.) */
+ if (!wtap_fdreopen(cf->wth, cf->filename, &err)) {
/* Oh, well, we're screwed. */
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
- file_open_error_message(err, FALSE), fname);
+ file_open_error_message(err, FALSE), cf->filename);
}
#endif
goto fail;