[banshee] FeedEnclosure: Clean up file path construction



commit 76238581460723a60ebdb048c0bacd3d472e9901
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Sun Oct 9 16:20:11 2011 +0200

    FeedEnclosure: Clean up file path construction
    
    Use Path.Combine instead of string concatenations.

 .../Migo/Migo.Syndication/FeedEnclosure.cs         |   14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)
---
diff --git a/src/Libraries/Migo/Migo.Syndication/FeedEnclosure.cs b/src/Libraries/Migo/Migo.Syndication/FeedEnclosure.cs
index 9fa2130..636f674 100644
--- a/src/Libraries/Migo/Migo.Syndication/FeedEnclosure.cs
+++ b/src/Libraries/Migo/Migo.Syndication/FeedEnclosure.cs
@@ -158,20 +158,10 @@ namespace Migo.Syndication
             if (filename.EndsWith (".torrent", StringComparison.OrdinalIgnoreCase)) {
                 filename = filename.Substring(0, filename.Length - 8);
             }
-            string tmpLocalPath;
-            string fullPath = path;
             string localEnclosurePath = Item.Feed.LocalEnclosurePath;
 
-            if (!localEnclosurePath.EndsWith (Path.DirectorySeparatorChar.ToString ())) {
-                localEnclosurePath += Path.DirectorySeparatorChar;
-            }
-
-            if (!fullPath.EndsWith (Path.DirectorySeparatorChar.ToString ())) {
-                fullPath += Path.DirectorySeparatorChar;
-            }
-
-            fullPath += filename;
-            tmpLocalPath = localEnclosurePath+filename;
+            string fullPath = Path.Combine (path, filename);
+            string tmpLocalPath = Path.Combine (localEnclosurePath, filename);
 
             try {
                 if (!Directory.Exists (path)) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]