From bff94896f9c37610fb9dec5c978dd19320c0aa50 Mon Sep 17 00:00:00 2001 From: zeromus Date: Mon, 12 Oct 2015 16:35:45 -0500 Subject: [PATCH] fix "multiple screenshots within the same second" better. it used to conk out on the 4th. to test this I had to build a robot since reyvgm's supersonic finger was unavailable --- BizHawk.Client.EmuHawk/MainForm.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 19af808367..a27cd866ec 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -878,12 +878,13 @@ namespace BizHawk.Client.EmuHawk string fname_bare = string.Format(fmt, prefix, ts, ""); string fname = string.Format(fmt, prefix, ts, " (0)"); - //if this file already exists, - //1. move the original file to a numbered one (to keep a good filesystem sort ordering) - if (File.Exists(fname_bare)) + //if the (0) filename exists, do nothing. we'll bump up the number later + //if the bare filename exists, move it to (0) + //otherwise, no related filename exists, and we can proceed with the bare filename + if (File.Exists(fname)) { } + else if (File.Exists(fname_bare)) File.Move(fname_bare, fname); else fname = fname_bare; - //2. create next one sequentially named int seq = 0; while (File.Exists(fname)) {