diff options
author | Anirudh Agnihotry <anirudhagnihotry098@gmail.com> | 2017-11-30 22:54:26 +0300 |
---|---|---|
committer | Stephen Toub <stoub@microsoft.com> | 2017-12-01 21:32:00 +0300 |
commit | 58f9c991887293ca8a9ca375c63e15b2e9664798 (patch) | |
tree | 92fe3b747710fade1ad73a7b4880086e539a942c | |
parent | e0d999b6e85b325beada1f3cfec205d2cdf34684 (diff) |
Removed Check Invalid Path Chars (dotnet/coreclr#15191)
Removed Check Invalid Chars from Coreclr
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
4 files changed, 0 insertions, 43 deletions
diff --git a/src/System.Private.CoreLib/shared/System/IO/Path.Unix.cs b/src/System.Private.CoreLib/shared/System/IO/Path.Unix.cs index 4ed5069b3..61a8314ac 100644 --- a/src/System.Private.CoreLib/shared/System/IO/Path.Unix.cs +++ b/src/System.Private.CoreLib/shared/System/IO/Path.Unix.cs @@ -25,8 +25,6 @@ namespace System.IO if (path.Length == 0) throw new ArgumentException(SR.Arg_PathEmpty, nameof(path)); - PathInternal.CheckInvalidPathChars(path); - // Expand with current directory if necessary if (!IsPathRooted(path)) { @@ -176,7 +174,6 @@ namespace System.IO if (path == null) return false; - PathInternal.CheckInvalidPathChars(path); return path.Length > 0 && path[0] == PathInternal.DirectorySeparatorChar; } diff --git a/src/System.Private.CoreLib/shared/System/IO/Path.Windows.cs b/src/System.Private.CoreLib/shared/System/IO/Path.Windows.cs index 373234782..5d92d3b49 100644 --- a/src/System.Private.CoreLib/shared/System/IO/Path.Windows.cs +++ b/src/System.Private.CoreLib/shared/System/IO/Path.Windows.cs @@ -119,8 +119,6 @@ namespace System.IO { if (path != null) { - PathInternal.CheckInvalidPathChars(path); - int length = path.Length; if ((length >= 1 && PathInternal.IsDirectorySeparator(path[0])) || (length >= 2 && PathInternal.IsValidDriveChar(path[0]) && path[1] == PathInternal.VolumeSeparatorChar)) @@ -144,8 +142,6 @@ namespace System.IO if (PathInternal.IsEffectivelyEmpty(path)) throw new ArgumentException(SR.Arg_PathEmpty, nameof(path)); - PathInternal.CheckInvalidPathChars(path); - // Need to return the normalized directory separator path = PathInternal.NormalizeDirectorySeparators(path); diff --git a/src/System.Private.CoreLib/shared/System/IO/Path.cs b/src/System.Private.CoreLib/shared/System/IO/Path.cs index c9b9ed0cd..9f3f48600 100644 --- a/src/System.Private.CoreLib/shared/System/IO/Path.cs +++ b/src/System.Private.CoreLib/shared/System/IO/Path.cs @@ -41,8 +41,6 @@ namespace System.IO { if (path != null) { - PathInternal.CheckInvalidPathChars(path); - string s = path; for (int i = path.Length - 1; i >= 0; i--) { @@ -81,7 +79,6 @@ namespace System.IO if (PathInternal.IsEffectivelyEmpty(path)) throw new ArgumentException(SR.Arg_PathEmpty, nameof(path)); - PathInternal.CheckInvalidPathChars(path); path = PathInternal.NormalizeDirectorySeparators(path); int root = PathInternal.GetRootLength(path); @@ -104,7 +101,6 @@ namespace System.IO if (path == null) return null; - PathInternal.CheckInvalidPathChars(path); int length = path.Length; for (int i = length - 1; i >= 0; i--) { @@ -194,8 +190,6 @@ namespace System.IO { if (path != null) { - PathInternal.CheckInvalidPathChars(path); - for (int i = path.Length - 1; i >= 0; i--) { char ch = path[i]; @@ -214,9 +208,6 @@ namespace System.IO if (path1 == null || path2 == null) throw new ArgumentNullException((path1 == null) ? nameof(path1) : nameof(path2)); - PathInternal.CheckInvalidPathChars(path1); - PathInternal.CheckInvalidPathChars(path2); - return CombineNoChecks(path1, path2); } @@ -225,10 +216,6 @@ namespace System.IO if (path1 == null || path2 == null || path3 == null) throw new ArgumentNullException((path1 == null) ? nameof(path1) : (path2 == null) ? nameof(path2) : nameof(path3)); - PathInternal.CheckInvalidPathChars(path1); - PathInternal.CheckInvalidPathChars(path2); - PathInternal.CheckInvalidPathChars(path3); - return CombineNoChecks(path1, path2, path3); } @@ -237,11 +224,6 @@ namespace System.IO if (path1 == null || path2 == null || path3 == null || path4 == null) throw new ArgumentNullException((path1 == null) ? nameof(path1) : (path2 == null) ? nameof(path2) : (path3 == null) ? nameof(path3) : nameof(path4)); - PathInternal.CheckInvalidPathChars(path1); - PathInternal.CheckInvalidPathChars(path2); - PathInternal.CheckInvalidPathChars(path3); - PathInternal.CheckInvalidPathChars(path4); - return CombineNoChecks(path1, path2, path3, path4); } @@ -270,8 +252,6 @@ namespace System.IO continue; } - PathInternal.CheckInvalidPathChars(paths[i]); - if (IsPathRooted(paths[i])) { firstComponent = i; diff --git a/src/System.Private.CoreLib/shared/System/IO/PathInternal.cs b/src/System.Private.CoreLib/shared/System/IO/PathInternal.cs index 9362636f8..bfd69e925 100644 --- a/src/System.Private.CoreLib/shared/System/IO/PathInternal.cs +++ b/src/System.Private.CoreLib/shared/System/IO/PathInternal.cs @@ -11,21 +11,6 @@ namespace System.IO internal static partial class PathInternal { /// <summary> - /// Checks for invalid path characters in the given path. - /// </summary> - /// <exception cref="System.ArgumentNullException">Thrown if the path is null.</exception> - /// <exception cref="System.ArgumentException">Thrown if the path has invalid characters.</exception> - /// <param name="path">The path to check for invalid characters.</param> - internal static void CheckInvalidPathChars(string path) - { - if (path == null) - throw new ArgumentNullException(nameof(path)); - - if (HasIllegalCharacters(path)) - throw new ArgumentException(SR.Argument_InvalidPathChars, nameof(path)); - } - - /// <summary> /// Returns the start index of the filename /// in the given path, or 0 if no directory /// or volume separator is found. @@ -40,7 +25,6 @@ namespace System.IO internal static int FindFileNameIndex(string path) { Debug.Assert(path != null); - CheckInvalidPathChars(path); for (int i = path.Length - 1; i >= 0; i--) { |