From 66730f9f7f01daba31721a1f890e36c56fad8ee7 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 5 Jan 2013 14:03:47 +0100 Subject: [PATCH] controller: add temporary block to migrate keys to none space containing file names --- SparkleShare/SparkleControllerBase.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/SparkleShare/SparkleControllerBase.cs b/SparkleShare/SparkleControllerBase.cs index 6ef6378f..c6f18fdd 100644 --- a/SparkleShare/SparkleControllerBase.cs +++ b/SparkleShare/SparkleControllerBase.cs @@ -196,6 +196,15 @@ namespace SparkleShare { foreach (string file_name in Directory.GetFiles (keys_path)) { if (file_name.EndsWith (".key")) { key_file_path = Path.Combine (keys_path, file_name); + + // Replace spaces with underscores in old keys + if (file_name.Contains (" ")) { + string new_file_name = file_name.Replace (" ", "_"); + File.Move (key_file_path, Path.Combine (keys_path)); + File.Move (key_file_path + ".pub", Path.Combine (keys_path, new_file_name + ".pub")); + key_file_path = Path.Combine (keys_path, new_file_name); + } + SparkleKeys.ImportPrivateKey (key_file_path); break;