Trim target path properly

This commit is contained in:
Ulf Hedlund
2017-09-02 00:07:06 +02:00
parent a446e31f9d
commit 7150eecd5b
+3 -1
View File
@@ -45,8 +45,10 @@ namespace Duplicati.Library.Backend.Sia
m_targetpath = options[SIA_TARGETPATH];
}
if (m_targetpath.StartsWith("/"))
while (m_targetpath.StartsWith("/"))
m_targetpath = m_targetpath.Substring(1);
while (m_targetpath.EndsWith("/"))
m_targetpath = m_targetpath.Remove(m_targetpath.Length - 1);
if (m_targetpath.Length == 0)
m_targetpath = "backup";