From febc13d4f4d5af0a7f083a67865058b61436513f Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Thu, 14 Jun 2012 13:54:59 +0100 Subject: [PATCH] Allow apostrophes and single quotes in folder names, but don't allow double quotes. Fixes #787 --- SparkleLib/Git/SparkleFetcherGit.cs | 12 +++++------- SparkleLib/SparkleConfig.cs | 4 ++-- SparkleShare/SparkleSetupController.cs | 3 ++- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/SparkleLib/Git/SparkleFetcherGit.cs b/SparkleLib/Git/SparkleFetcherGit.cs index 7c5cb5ee..d5e69cff 100755 --- a/SparkleLib/Git/SparkleFetcherGit.cs +++ b/SparkleLib/Git/SparkleFetcherGit.cs @@ -43,7 +43,7 @@ namespace SparkleLib.Git { !uri.Scheme.Equals ("http") && !uri.Scheme.Equals ("git")) { - uri = new Uri ("ssh://" + uri); + uri = new Uri ("ssh://" + uri); } if (uri.Host.Equals ("gitorious.org")) { @@ -67,12 +67,10 @@ namespace SparkleLib.Git { !uri.Scheme.Equals ("https") && !uri.Scheme.Equals ("http")) { - if (uri.Port == -1) { - uri = new Uri (uri.Scheme + "://git@" + uri.Host + uri.AbsolutePath); - - } else { - uri = new Uri (uri.Scheme + "://git@" + uri.Host + ":" + uri.Port + uri.AbsolutePath); - } + if (uri.Port == -1) + uri = new Uri (uri.Scheme + "://git@" + uri.Host + uri.AbsolutePath); + else + uri = new Uri (uri.Scheme + "://git@" + uri.Host + ":" + uri.Port + uri.AbsolutePath); } } diff --git a/SparkleLib/SparkleConfig.cs b/SparkleLib/SparkleConfig.cs index edf31e31..fcbafd63 100755 --- a/SparkleLib/SparkleConfig.cs +++ b/SparkleLib/SparkleConfig.cs @@ -84,7 +84,7 @@ namespace SparkleLib { } FullPath = Path.Combine (config_path, config_file_name); - LogFilePath = Path.Combine (config_path, "debug.log"); + LogFilePath = Path.Combine (config_path, "debug.txt"); if (File.Exists (LogFilePath)) { try { @@ -296,7 +296,7 @@ namespace SparkleLib { private XmlNode GetFolder (string name) { - return SelectSingleNode (string.Format ("/sparkleshare/folder[name='{0}']", name)); + return SelectSingleNode (string.Format ("/sparkleshare/folder[name=\"{0}\"]", name)); } diff --git a/SparkleShare/SparkleSetupController.cs b/SparkleShare/SparkleSetupController.cs index 8c5f61bf..1ba12cd1 100755 --- a/SparkleShare/SparkleSetupController.cs +++ b/SparkleShare/SparkleSetupController.cs @@ -384,7 +384,8 @@ namespace SparkleShare { bool fields_valid = (address != null && address.Trim ().Length > 0 && remote_path != null && - remote_path.Trim ().Length > 0); + remote_path.Trim ().Length > 0 && + !remote_path.Contains ("\"")); if (UpdateAddProjectButtonEvent != null) UpdateAddProjectButtonEvent (fields_valid);