lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From si...@apache.org
Subject svn commit: r1366892 - /incubator/lucene.net/trunk/test/core/Util/Paths.cs
Date Sun, 29 Jul 2012 19:08:54 GMT
Author: sisve
Date: Sun Jul 29 19:08:54 2012
New Revision: 1366892

URL: http://svn.apache.org/viewvc?rev=1366892&view=rev
Log:
Remove file:// prefix before calling Path.GetDirectoryName.

Modified:
    incubator/lucene.net/trunk/test/core/Util/Paths.cs

Modified: incubator/lucene.net/trunk/test/core/Util/Paths.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Util/Paths.cs?rev=1366892&r1=1366891&r2=1366892&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Util/Paths.cs (original)
+++ incubator/lucene.net/trunk/test/core/Util/Paths.cs Sun Jul 29 19:08:54 2012
@@ -103,13 +103,13 @@ namespace Lucene.Net.Util
                 {
                     s_assemblyDirectory = typeof(Paths).Assembly.CodeBase;
 
+                    // CodeBase uses unc path, get rid of the file prefix if it exists. 

+                    if (s_assemblyDirectory.StartsWith("file://")) {
+                        s_assemblyDirectory = s_assemblyDirectory.Substring(7);
+                    }
 
                     // ensure that we're only getting the directory.
                     s_assemblyDirectory = Path.GetDirectoryName(s_assemblyDirectory);
-
-                    // CodeBase uses unc path, get rid of the file prefix if it exists. 

-                    if (s_assemblyDirectory.StartsWith("file:"))
-                        s_assemblyDirectory = s_assemblyDirectory.Replace(("file:" + Path.DirectorySeparatorChar).ToString(),
"");
                 }
                 return s_assemblyDirectory;
             }



Mime
View raw message