mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
feat: handle UNC paths in FileDialog (#2191)
This commit is contained in:
parent
01b3a5428e
commit
3a990b77f0
1 changed files with 14 additions and 0 deletions
|
|
@ -36,6 +36,20 @@ public partial class FileDialog
|
|||
|
||||
private static string ComposeNewPath(List<string> decomp)
|
||||
{
|
||||
// Handle UNC paths (network paths)
|
||||
if (decomp.Count >= 2 && string.IsNullOrEmpty(decomp[0]) && string.IsNullOrEmpty(decomp[1]))
|
||||
{
|
||||
var pathParts = new List<string>(decomp);
|
||||
pathParts.RemoveRange(0, 2);
|
||||
// Can not access server level or UNC root
|
||||
if (pathParts.Count <= 1)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
return $"\\\\{string.Join('\\', pathParts)}";
|
||||
}
|
||||
|
||||
if (decomp.Count == 1)
|
||||
{
|
||||
var drivePath = decomp[0];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue