You've already forked linux-packaging-mono
Imported Upstream version 5.16.0.100
Former-commit-id: 38faa55fb9669e35e7d8448b15c25dc447f25767
This commit is contained in:
parent
0a9828183b
commit
7d7f676260
@ -951,6 +951,26 @@ namespace System.IO {
|
||||
return path1 + DirectorySeparatorCharAsString + path2;
|
||||
return path1 + path2;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Copied from corefx
|
||||
|
||||
public static ReadOnlySpan<char> GetFileName(ReadOnlySpan<char> path)
|
||||
{
|
||||
int root = GetPathRoot(new string (path)).Length;
|
||||
|
||||
// We don't want to cut off "C:\file.txt:stream" (i.e. should be "file.txt:stream")
|
||||
// but we *do* want "C:Foo" => "Foo". This necessitates checking for the root.
|
||||
|
||||
for (int i = path.Length; --i >= 0;)
|
||||
{
|
||||
if (i < root || IsDirectorySeparator(path[i]))
|
||||
return path.Slice(i + 1, path.Length - i - 1);
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user