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

github.com/duplicati/duplicati.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Skovhede <kenneth@hexad.dk>2019-02-06 17:14:01 +0300
committerGitHub <noreply@github.com>2019-02-06 17:14:01 +0300
commit7281d342d4777a4dbe41aede5d5407c9b63f22ea (patch)
treec8a11c5744137b9dbc2ec1f80f56697aa8d6ffab
parent02968c8eacfee68c7de5c163b687c18d66890921 (diff)
parentc01ab02712b4504ed0da3f85baa5c7d36a46e65d (diff)
Merge pull request #3649 from duplicati/feature/fix_root_path_issue
Added support for "splitting" a root path.
-rw-r--r--Duplicati/Library/Main/Database/LocalDatabase.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Duplicati/Library/Main/Database/LocalDatabase.cs b/Duplicati/Library/Main/Database/LocalDatabase.cs
index 17bfa001d..912137776 100644
--- a/Duplicati/Library/Main/Database/LocalDatabase.cs
+++ b/Duplicati/Library/Main/Database/LocalDatabase.cs
@@ -1482,14 +1482,14 @@ ORDER BY
/// <param name="path">The path to split.</param>
public static KeyValuePair<string, string> SplitIntoPrefixAndName(string path)
{
- if (path == null || path.Length == 0)
+ if (string.IsNullOrEmpty(path))
throw new ArgumentException($"Invalid path: {path}", nameof(path));
int nLast = path.TrimEnd(_pathseparators).LastIndexOfAny(_pathseparators);
if (nLast >= 0)
return new KeyValuePair<string, string>(path.Substring(0, nLast + 1), path.Substring(nLast + 1));
- throw new ArgumentException($"Invalid path: {path}", nameof(path));
+ return new KeyValuePair<string, string>(string.Empty, path);
}
}
}