Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaPhie79 <33412188+daPhie79@users.noreply.github.com>2017-12-09 05:37:05 +0300
committerdaPhie79 <33412188+daPhie79@users.noreply.github.com>2017-12-09 05:37:05 +0300
commit43ae3cf48c3cb636781ddb1748b137d7727487dc (patch)
tree41fc4a987573f51fe54cfba873d8caa4a5914509
parentff7f200496cd031761ea7fb2f03acbf8726972f7 (diff)
parent3e8af5d45b2d1c0aa4fd9879283cb6b3d418dbac (diff)
Merge branch 'stable' into improve_automaticfindcover
-rw-r--r--SaveStateManager.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/SaveStateManager.cs b/SaveStateManager.cs
index f50056bc..92077f75 100644
--- a/SaveStateManager.cs
+++ b/SaveStateManager.cs
@@ -7,6 +7,7 @@ using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Text;
+using System.Text.RegularExpressions;
using System.Threading;
using System.Windows.Forms;
@@ -191,9 +192,12 @@ namespace com.clusterrr.hakchi_gui
{
try
{
+ string invalidChars = new string(Path.GetInvalidFileNameChars());
+ Regex removeInvalidChars = new Regex($"[{Regex.Escape(invalidChars)}]", RegexOptions.Singleline | RegexOptions.Compiled | RegexOptions.CultureInvariant);
+
foreach (ListViewItem game in listViewSaves.SelectedItems)
{
- saveFileDialog.FileName = game.SubItems["colName"].Text + ".clvs";
+ saveFileDialog.FileName = removeInvalidChars.Replace(game.SubItems["colName"].Text, "") + ".clvs";
var name = game.SubItems["colName"].Text != null ? game.SubItems["colName"].Text : "save";
saveFileDialog.Title = name;
if (saveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)