From ff54192fdc4bbb4f1313328c3a86702ea054fef6 Mon Sep 17 00:00:00 2001 From: goyuken Date: Sun, 30 Nov 2014 04:02:31 +0000 Subject: [PATCH] fix missing movie extension for game names that have a . at Length-4 --- BizHawk.Client.EmuHawk/movie/RecordMovie.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/BizHawk.Client.EmuHawk/movie/RecordMovie.cs b/BizHawk.Client.EmuHawk/movie/RecordMovie.cs index 939cfbfab6..5063fd5e72 100644 --- a/BizHawk.Client.EmuHawk/movie/RecordMovie.cs +++ b/BizHawk.Client.EmuHawk/movie/RecordMovie.cs @@ -1,6 +1,7 @@ using System; using System.IO; using System.Windows.Forms; +using System.Linq; using BizHawk.Common.ReflectionExtensions; using BizHawk.Emulation.Common; @@ -34,13 +35,14 @@ namespace BizHawk.Client.EmuHawk path = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPathFragment, null) + path; - if (path[path.Length - 4] != '.') // If no file extension, add movie extension + if (!MovieService.MovieExtensions.Contains(Path.GetExtension(path))) { - path += "." + MovieService.DefaultExtension; + // If no valid movie extension, add movie extension + path += "." + MovieService.DefaultExtension; } } } - + return path; }