diff options
author | Jiyoung Yun <jy910.yun@samsung.com> | 2017-02-10 20:35:12 +0900 |
---|---|---|
committer | Jiyoung Yun <jy910.yun@samsung.com> | 2017-02-10 20:35:12 +0900 |
commit | 4b11dc566a5bbfa1378d6266525c281b028abcc8 (patch) | |
tree | b48831a898906734f8884d08b6e18f1144ee2b82 /src/mscorlib/corefx/System/IO/PathInternal.Windows.StringBuffer.cs | |
parent | db20f3f1bb8595633a7e16c8900fd401a453a6b5 (diff) | |
download | coreclr-4b11dc566a5bbfa1378d6266525c281b028abcc8.tar.gz coreclr-4b11dc566a5bbfa1378d6266525c281b028abcc8.tar.bz2 coreclr-4b11dc566a5bbfa1378d6266525c281b028abcc8.zip |
Imported Upstream version 1.0.0.9910upstream/1.0.0.9910
Diffstat (limited to 'src/mscorlib/corefx/System/IO/PathInternal.Windows.StringBuffer.cs')
-rw-r--r-- | src/mscorlib/corefx/System/IO/PathInternal.Windows.StringBuffer.cs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/mscorlib/corefx/System/IO/PathInternal.Windows.StringBuffer.cs b/src/mscorlib/corefx/System/IO/PathInternal.Windows.StringBuffer.cs index fec2218844..84953df37b 100644 --- a/src/mscorlib/corefx/System/IO/PathInternal.Windows.StringBuffer.cs +++ b/src/mscorlib/corefx/System/IO/PathInternal.Windows.StringBuffer.cs @@ -13,7 +13,7 @@ namespace System.IO /// <summary> /// Returns true if the path uses the extended syntax (\\?\) /// </summary> - internal static bool IsExtended(StringBuffer path) + internal static bool IsExtended(ref StringBuffer path) { // While paths like "//?/C:/" will work, they're treated the same as "\\.\" paths. // Skipping of normalization will *only* occur if back slashes ('\') are used. @@ -27,20 +27,24 @@ namespace System.IO /// <summary> /// Gets the length of the root of the path (drive, share, etc.). /// </summary> - internal unsafe static uint GetRootLength(StringBuffer path) + internal unsafe static int GetRootLength(ref StringBuffer path) { if (path.Length == 0) return 0; - return GetRootLength(path.CharPointer, path.Length); + + fixed (char* value = path.UnderlyingArray) + { + return GetRootLength(value, path.Length); + } } /// <summary> /// Returns true if the path uses any of the DOS device path syntaxes. ("\\.\", "\\?\", or "\??\") /// </summary> - internal static bool IsDevice(StringBuffer path) + internal static bool IsDevice(ref StringBuffer path) { // If the path begins with any two separators is will be recognized and normalized and prepped with // "\??\" for internal usage correctly. "\??\" is recognized and handled, "/??/" is not. - return IsExtended(path) + return IsExtended(ref path) || ( path.Length >= DevicePrefixLength @@ -63,7 +67,7 @@ namespace System.IO /// for C: (rooted, but relative). "C:\a" is rooted and not relative (the current directory /// will not be used to modify the path). /// </remarks> - internal static bool IsPartiallyQualified(StringBuffer path) + internal static bool IsPartiallyQualified(ref StringBuffer path) { if (path.Length < 2) { @@ -82,7 +86,7 @@ namespace System.IO // The only way to specify a fixed path that doesn't begin with two slashes // is the drive, colon, slash format- i.e. C:\ return !((path.Length >= 3) - && (path[1] == Path.VolumeSeparatorChar) + && (path[1] == VolumeSeparatorChar) && IsDirectorySeparator(path[2])); } } |