diff options
Diffstat (limited to 'MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs')
| -rw-r--r-- | MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs b/MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs index 24ac48e83..014fd6f82 100644 --- a/MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs +++ b/MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs @@ -351,18 +351,21 @@ namespace MediaBrowser.Common.Implementations.IO throw new ArgumentNullException("to"); } - path = path.Replace(from, to, StringComparison.OrdinalIgnoreCase); + var newPath = path.Replace(from, to, StringComparison.OrdinalIgnoreCase); - if (to.IndexOf('/') != -1) + if (!string.Equals(newPath, path)) { - path = path.Replace('\\', '/'); - } - else - { - path = path.Replace('/', '\\'); + if (to.IndexOf('/') != -1) + { + newPath = path.Replace('\\', '/'); + } + else + { + newPath = path.Replace('/', '\\'); + } } - return path; + return newPath; } } } |
