diff options
author | Marek Safar <marek.safar@gmail.com> | 2018-09-19 15:19:22 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-19 15:19:22 +0300 |
commit | efd29b5cf854679349066e22ef9038b8cfe76d94 (patch) | |
tree | 2de750c1ac8a487d7f6d149592a6362ade6a5a77 /src/System.Private.CoreLib/shared/System/IO/Path.Unix.cs | |
parent | f9124d69e41d42196510dd7234b2d53fed48ad4c (diff) | |
parent | 49f9ed0e66fc2d4cd682821396c6af5e80182048 (diff) |
Merge pull request #25 from ntherning/bump-corert
Bump to latest upstream
Diffstat (limited to 'src/System.Private.CoreLib/shared/System/IO/Path.Unix.cs')
-rw-r--r-- | src/System.Private.CoreLib/shared/System/IO/Path.Unix.cs | 4 |
1 files changed, 2 insertions, 2 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 fd24cc810..ecf71e612 100644 --- a/src/System.Private.CoreLib/shared/System/IO/Path.Unix.cs +++ b/src/System.Private.CoreLib/shared/System/IO/Path.Unix.cs @@ -23,7 +23,7 @@ namespace System.IO if (path.Length == 0) throw new ArgumentException(SR.Arg_PathEmpty, nameof(path)); - if (path.IndexOf('\0') != -1) + if (path.Contains('\0')) throw new ArgumentException(SR.Argument_InvalidPathChars, nameof(path)); // Expand with current directory if necessary @@ -34,7 +34,7 @@ namespace System.IO // We would ideally use realpath to do this, but it resolves symlinks, requires that the file actually exist, // and turns it into a full path, which we only want if fullCheck is true. - string collapsedString = RemoveRelativeSegments(path); + string collapsedString = PathInternal.RemoveRelativeSegments(path, PathInternal.GetRootLength(path)); Debug.Assert(collapsedString.Length < path.Length || collapsedString.ToString() == path, "Either we've removed characters, or the string should be unmodified from the input path."); |