No need to remove the old name after a save-with-move; it was, well, *moved*.
authorGuy Harris <guy@alum.mit.edu>
Fri, 29 Dec 2017 06:10:59 +0000 (22:10 -0800)
committerGuy Harris <guy@alum.mit.edu>
Fri, 29 Dec 2017 06:11:29 +0000 (06:11 +0000)
Change-Id: Ic76eee870aff69b9daaf80d99fa619bf762258a1
Reviewed-on: https://code.wireshark.org/review/25058
Reviewed-by: Guy Harris <guy@alum.mit.edu>
file.c

diff --git a/file.c b/file.c
index 6023e539d2f1875ec60e70cda6a2b6fdb53de174..ac6fce2a68eead529af079e5795684a8bd2f35cb 100644 (file)
--- a/file.c
+++ b/file.c
@@ -4477,7 +4477,7 @@ cf_save_records(capture_file *cf, const char *fname, guint save_format,
   /* If this was a temporary file, and we didn't do the save by doing
      a move, so the tempoary file is still around under its old name,
      remove it. */
-  if (cf->is_tempfile) {
+  if (cf->is_tempfile && how_to_save != SAVE_WITH_MOVE) {
     /* If this fails, there's not much we can do, so just ignore errors. */
     ws_unlink(cf->filename);
   }