aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs
diff options
context:
space:
mode:
authorTim Hobbs <jesus.tesh@gmail.com>2014-05-18 15:45:16 -0700
committerTim Hobbs <jesus.tesh@gmail.com>2014-05-18 15:45:16 -0700
commit6e1082563173b6b71b96fc8e38ff974f49c07add (patch)
treeebdf2c12344afd856c040b8396b288dc6be8f8e2 /MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs
parent0bf6fdb5a4050f30ac8100210a9fe9e2a48f63e2 (diff)
parent708d5a416ed373c158b3dc45952a1fd123fb74e8 (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser into upstream-master
Diffstat (limited to 'MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs')
-rw-r--r--MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs19
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;
}
}
}