diff options
Diffstat (limited to 'Prebuild/src/Core/Utilities')
-rw-r--r-- | Prebuild/src/Core/Utilities/CommandLineCollection.cs | 9 | ||||
-rw-r--r-- | Prebuild/src/Core/Utilities/CurrentDirectory.cs | 9 | ||||
-rw-r--r-- | Prebuild/src/Core/Utilities/Helper.cs | 25 | ||||
-rw-r--r-- | Prebuild/src/Core/Utilities/Log.cs | 9 |
4 files changed, 9 insertions, 43 deletions
diff --git a/Prebuild/src/Core/Utilities/CommandLineCollection.cs b/Prebuild/src/Core/Utilities/CommandLineCollection.cs index 5733547..22752aa 100644 --- a/Prebuild/src/Core/Utilities/CommandLineCollection.cs +++ b/Prebuild/src/Core/Utilities/CommandLineCollection.cs | |||
@@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O | |||
23 | */ | 23 | */ |
24 | #endregion | 24 | #endregion |
25 | 25 | ||
26 | #region CVS Information | ||
27 | /* | ||
28 | * $Source$ | ||
29 | * $Author: robloach $ | ||
30 | * $Date: 2006-09-26 07:30:53 +0900 (Tue, 26 Sep 2006) $ | ||
31 | * $Revision: 165 $ | ||
32 | */ | ||
33 | #endregion | ||
34 | |||
35 | using System; | 26 | using System; |
36 | using System.Collections; | 27 | using System.Collections; |
37 | using System.Collections.Specialized; | 28 | using System.Collections.Specialized; |
diff --git a/Prebuild/src/Core/Utilities/CurrentDirectory.cs b/Prebuild/src/Core/Utilities/CurrentDirectory.cs index abbed52..5fabdf0 100644 --- a/Prebuild/src/Core/Utilities/CurrentDirectory.cs +++ b/Prebuild/src/Core/Utilities/CurrentDirectory.cs | |||
@@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O | |||
23 | */ | 23 | */ |
24 | #endregion | 24 | #endregion |
25 | 25 | ||
26 | #region CVS Information | ||
27 | /* | ||
28 | * $Source$ | ||
29 | * $Author: jendave $ | ||
30 | * $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $ | ||
31 | * $Revision: 71 $ | ||
32 | */ | ||
33 | #endregion | ||
34 | |||
35 | using System; | 26 | using System; |
36 | using System.Collections; | 27 | using System.Collections; |
37 | 28 | ||
diff --git a/Prebuild/src/Core/Utilities/Helper.cs b/Prebuild/src/Core/Utilities/Helper.cs index 19093ce..9a0d131 100644 --- a/Prebuild/src/Core/Utilities/Helper.cs +++ b/Prebuild/src/Core/Utilities/Helper.cs | |||
@@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O | |||
23 | */ | 23 | */ |
24 | #endregion | 24 | #endregion |
25 | 25 | ||
26 | #region CVS Information | ||
27 | /* | ||
28 | * $Source$ | ||
29 | * $Author: jendave $ | ||
30 | * $Date: 2007-02-14 05:58:03 +0900 (Wed, 14 Feb 2007) $ | ||
31 | * $Revision: 205 $ | ||
32 | */ | ||
33 | #endregion | ||
34 | |||
35 | using System; | 26 | using System; |
36 | using System.Collections; | 27 | using System.Collections; |
37 | using System.Diagnostics; | 28 | using System.Diagnostics; |
@@ -289,6 +280,8 @@ namespace Prebuild.Core.Utilities | |||
289 | return true; | 280 | return true; |
290 | } | 281 | } |
291 | 282 | ||
283 | static readonly char seperator = Path.DirectorySeparatorChar; | ||
284 | |||
292 | // This little gem was taken from the NeL source, thanks guys! | 285 | // This little gem was taken from the NeL source, thanks guys! |
293 | /// <summary> | 286 | /// <summary> |
294 | /// Makes a relative path | 287 | /// Makes a relative path |
@@ -298,8 +291,8 @@ namespace Prebuild.Core.Utilities | |||
298 | /// <returns>Path that will get from startPath to endPath</returns> | 291 | /// <returns>Path that will get from startPath to endPath</returns> |
299 | public static string MakePathRelativeTo(string startPath, string endPath) | 292 | public static string MakePathRelativeTo(string startPath, string endPath) |
300 | { | 293 | { |
301 | string tmp = NormalizePath(startPath, '/'); | 294 | string tmp = NormalizePath(startPath, seperator); |
302 | string src = NormalizePath(endPath, '/'); | 295 | string src = NormalizePath(endPath, seperator); |
303 | string prefix = ""; | 296 | string prefix = ""; |
304 | 297 | ||
305 | while(true) | 298 | while(true) |
@@ -312,14 +305,14 @@ namespace Prebuild.Core.Utilities | |||
312 | { | 305 | { |
313 | return "./"; | 306 | return "./"; |
314 | } | 307 | } |
315 | if ((src.Length > tmp.Length) && src[tmp.Length-1] != '/' && src[tmp.Length-1] != '\\') | 308 | if((src.Length > tmp.Length) && src[tmp.Length - 1] != seperator) |
316 | { | 309 | { |
317 | } | 310 | } |
318 | else | 311 | else |
319 | { | 312 | { |
320 | ret = prefix + endPath.Substring(size, endPath.Length - size); | 313 | ret = prefix + endPath.Substring(size, endPath.Length - size); |
321 | ret = ret.Trim(); | 314 | ret = ret.Trim(); |
322 | if(ret[0] == '/' || ret[0] == '\\') | 315 | if(ret[0] == seperator) |
323 | { | 316 | { |
324 | ret = "." + ret; | 317 | ret = "." + ret; |
325 | } | 318 | } |
@@ -334,8 +327,8 @@ namespace Prebuild.Core.Utilities | |||
334 | break; | 327 | break; |
335 | } | 328 | } |
336 | 329 | ||
337 | int lastPos = tmp.LastIndexOf('/', tmp.Length - 2); | 330 | int lastPos = tmp.LastIndexOf(seperator, tmp.Length - 2); |
338 | int prevPos = tmp.IndexOf('/'); | 331 | int prevPos = tmp.IndexOf(seperator); |
339 | 332 | ||
340 | if((lastPos == prevPos) || (lastPos == -1)) | 333 | if((lastPos == prevPos) || (lastPos == -1)) |
341 | { | 334 | { |
@@ -343,7 +336,7 @@ namespace Prebuild.Core.Utilities | |||
343 | } | 336 | } |
344 | 337 | ||
345 | tmp = tmp.Substring(0, lastPos + 1); | 338 | tmp = tmp.Substring(0, lastPos + 1); |
346 | prefix += "../"; | 339 | prefix += ".." + seperator.ToString(); |
347 | } | 340 | } |
348 | 341 | ||
349 | return endPath; | 342 | return endPath; |
diff --git a/Prebuild/src/Core/Utilities/Log.cs b/Prebuild/src/Core/Utilities/Log.cs index e8105ac..548e987 100644 --- a/Prebuild/src/Core/Utilities/Log.cs +++ b/Prebuild/src/Core/Utilities/Log.cs | |||
@@ -23,15 +23,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O | |||
23 | */ | 23 | */ |
24 | #endregion | 24 | #endregion |
25 | 25 | ||
26 | #region CVS Information | ||
27 | /* | ||
28 | * $Source$ | ||
29 | * $Author: jendave $ | ||
30 | * $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $ | ||
31 | * $Revision: 71 $ | ||
32 | */ | ||
33 | #endregion | ||
34 | |||
35 | using System; | 26 | using System; |
36 | using System.IO; | 27 | using System.IO; |
37 | 28 | ||